Opened 14 years ago
Closed 14 years ago
#14724 closed defect (bug) (invalid)
manage_$(taxonomy)_custom_column limits plugin interaction
Reported by: | nerrad | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | close |
Focuses: | Cc: |
Description
Having trouble coming up with a descriptive title.
Here's the problem:
I have one plugin that creates a custom taxonomy ('series') and I can populate the new column on the 'edit-tags?taxonomy=series' page fine (named 'icon'). For this plugin I use the 'manage_series_custom_column' filter to add in the content for that column. For example:
add_filter('manage_series_custom_column','my_first_plugin_column',1,3) function my_first_plugin_column($unknown, $column_name, $id) { if ($column_name == 'icon') { $data = get_some_data(); $return $data; } }
This works as expected and I see the column 'Series' with it's content.
Here's the problem. I've created an "addon" for my original plugin that also hooks into the table on the 'edit-tags.php?taxonomy=series' page. I've successfully created the "group" column and it sets up the column correctly. Then I hook into the custom column filter like so:
add_filter('manage_series_custom_column','my_second_plugin_column',1,3) function my_second_plugin_column($unknown, $column_name, $id) { if ( $column_name == 'group' ) { $data = get_some_data(); $return $data; } }
The PROBLEM is that the data for the second plugin DOES NOT display. Funny thing is when I do a var_dump on the data it is there. But somehow it's getting lost in the apply_filter() routine. I've also tried playing around with the priority. Whichever custom_column is given the higher priority is the one that will display and the other one won't.
Am I missing something?
Assuming
$return
is a typo, the problem is that the first parameter isn'tunknown
, but rather it is the value of the filter. By default, there are no custom columns, and thus it is empty. But you need to concatenate the first variable with what you want to add to it, and return all of that. And you still need to always return data -- if column name doesn't equal group, then no data will get returned, and that'll screw things up pretty well. (The final aspect is probably what is hiding the first column.)