Hello everyone,
I would like to add a function in my code. When I add it to “admin.php” or “setup.php”, I get an error
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘myplugin_settings’ not found or invalid function name
If I put my function in “functions.php”, it works.
Is there a way to put it in one of the files mentioned above?
Thank you
function myplugin_settings() {
// Add tag metabox to page
register_taxonomy_for_object_type('post_tag', 'page');
// Add category metabox to page
register_taxonomy_for_object_type('category', 'page');
}
// Add to the admin_init hook of your theme functions.php file
add_action( 'init', 'myplugin_settings' );