admin管理员组文章数量:1122846
When I am using manage_media_columns
filter of the WordPress I am getting the fatal error.
This is the code I have added in my functions.php file.
add_filter('manage_media_columns' , 'book_cpt_columns');
function book_cpt_columns($columns) {
$new_columns = array(
'publisher' => __('Publisher', 'ThemeName'),
'book_author' => __('Book Author', 'ThemeName'),
);
return array_merge($columns, $new_columns);
}
Error I am getting is "Too few arguments fatal error in Add New Media File page error."
When I am using manage_media_columns
filter of the WordPress I am getting the fatal error.
This is the code I have added in my functions.php file.
add_filter('manage_media_columns' , 'book_cpt_columns');
function book_cpt_columns($columns) {
$new_columns = array(
'publisher' => __('Publisher', 'ThemeName'),
'book_author' => __('Book Author', 'ThemeName'),
);
return array_merge($columns, $new_columns);
}
Error I am getting is "Too few arguments fatal error in Add New Media File page error."
Share Improve this question edited Jul 9, 2024 at 7:07 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Jul 9, 2024 at 5:09 Ashok KumarAshok Kumar 433 bronze badges1 Answer
Reset to default 2It looks like the issue is coming because of the conflict of the hooks (manage_media_columns
and manage_{$screen->id}_columns
) because when we manage_{$screen->id}_columns
used for media it becomes manage_media_columns
and started conflicting.
The same details are mentioned in the documentation link of the hook.
Link: https://developer.wordpress.org/reference/hooks/manage_screen-id_columns/#more-information
本文标签: hooksGetting fatal error when using managemediacolumns filter of WordPress
版权声明:本文标题:hooks - Getting fatal error when using manage_media_columns filter of WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301428a1931173.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论