-
Notifications
You must be signed in to change notification settings - Fork 159
Add categories to pull screen - 1 #1237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 20 commits
85d9457
7fee3dd
8ef5b57
32c11d0
d3d6648
4ad5180
8d71ce7
0a82a88
98d6346
93090a0
4c249a8
b1ad11d
26480c1
74319fe
e31a171
4e8ed85
8df0fa9
bd2d8eb
ab0bfc3
0850705
b6431d2
90acb95
e9678bd
3708300
fb369f5
cbdf94f
f867c43
e41fd70
bd41e0a
0947ec3
49f4a33
ffbafbc
93efd0d
93406da
8cafad1
c7809e2
c5bb1d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ | |
|
|
||
| namespace Distributor; | ||
|
|
||
| use function Distributor\Utils\generate_taxonomy_links; | ||
|
|
||
| /** | ||
| * List table class for pull screen | ||
| */ | ||
|
|
@@ -54,10 +56,11 @@ public function __construct() { | |
| */ | ||
| public function get_columns() { | ||
| $columns = [ | ||
| 'cb' => '<input type="checkbox" />', | ||
| 'name' => esc_html__( 'Name', 'distributor' ), | ||
| 'post_type' => esc_html__( 'Post Type', 'distributor' ), | ||
| 'date' => esc_html__( 'Date', 'distributor' ), | ||
| 'cb' => '<input type="checkbox" />', | ||
| 'name' => esc_html__( 'Name', 'distributor' ), | ||
| 'post_type' => esc_html__( 'Post Type', 'distributor' ), | ||
| 'categories' => esc_html__( 'Categories', 'distributor' ), | ||
| 'date' => esc_html__( 'Date', 'distributor' ), | ||
| ]; | ||
|
|
||
| /** | ||
|
|
@@ -247,14 +250,30 @@ public function column_date( $post ) { | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Output categories column. | ||
| * | ||
| * @param \WP_Post $post Post object. | ||
| * @since 2.0.5 | ||
| */ | ||
| public function column_categories( $post ) { | ||
| $categories = $post->terms['category'] ?? []; | ||
|
|
||
| if ( empty( $categories ) ) { | ||
| return; | ||
| } | ||
|
|
||
| echo wp_kses_post( generate_taxonomy_links( 'category', $post, $categories ) ); | ||
| } | ||
|
|
||
| /** | ||
| * Output standard table columns. | ||
| * | ||
| * @param array|\WP_Post $item Item to output. | ||
| * @param string $column_name Column name. | ||
| * | ||
| * @return string. | ||
| * @since 0.8 | ||
| * @since 2.0.5 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the version bumped for this existing function?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kirtangajjar ^ see above question for you
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have reverted it to the original |
||
| */ | ||
| public function column_default( $item, $column_name ) { | ||
| if ( 'post_type' === $column_name ) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.