@@ 126-136 (lines=11) @@ | ||
123 | * @param array $columns |
|
124 | * @return array |
|
125 | */ |
|
126 | function modify_table_columns( $columns ) |
|
127 | { |
|
128 | $this->traverse_components(function( $taxonomy, $component ) use ( &$columns ) |
|
129 | { |
|
130 | if( $component->table['show'] ) |
|
131 | { |
|
132 | $columns[$component->name] = $component->title; |
|
133 | } |
|
134 | }); |
|
135 | return $columns; |
|
136 | } |
|
137 | ||
138 | /** |
|
139 | * Retrieve the data for a given column in the term table. |
|
@@ 169-180 (lines=12) @@ | ||
166 | * @param array $columns |
|
167 | * @return string |
|
168 | */ |
|
169 | function modify_table_sortable_columns( $columns ) |
|
170 | { |
|
171 | $this->traverse_components(function( $taxonomy, $component ) use ( &$columns ) |
|
172 | { |
|
173 | if( $component->table['show'] && |
|
174 | $component->table['sortable'] |
|
175 | ) { |
|
176 | $columns[$component->name] = $component->name; |
|
177 | } |
|
178 | }); |
|
179 | return $columns; |
|
180 | } |
|
181 | ||
182 | /** |
|
183 | * Modify terms_clauses to allow sorting custom WordPress Admin Table Columns by a custom Taxonomy Term meta |