-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
add option to change "More Fields" metabox title #727
Comments
Use the new 'pods_meta_default_box_title' filter |
Ok. So add_filter('pods_meta_default_box_title','changethatname'); function changethatname($value) { for example, works. How can we modify the above to specify different default box titles for different Pods? |
srikat - you probably worked this out already but I hope someone else finds this useful: add_filter('pods_meta_default_box_title','changethatname',10,5);
/* See http://codex.wordpress.org/Function_Reference/add_filter */
function changethatname($title, $pod, $fields, $type, $name ) {
// assuming we are changing the meta box title on a pod named 'page'
$title = ($name=='page') ? __('My Meta box title', 'plugin_lang') : $title ;
return $title;
} |
What would be the code to change the meta titles for multiple post types? |
add_filter( 'pods_meta_default_box_title', 'my_change_pods_metabox_title', 10, 5 );
/**
* Filter the title of the Pods metabox for multiple post types.
*
* @param string $title The title to use, default is 'More Fields'.
* @param obj|Pods $pod Current Pods Object.
* @param array $fields List of fields that will go in the metabox.
* @param string $type The type of Pod.
* @param string $name Name of the Pod.
*
* @return string The title for the metabox.
*
* @since unknown
*/
function my_change_pods_metabox_title( $title, $pod, $fields, $type, $name ) {
$post_types_to_change = [
'my_custom_post_type',
'post',
'page',
];
if ( ! in_array( $name, $post_types_to_change, true ) ) {
return $title;
}
return 'My custom title';
} cc @jimtrue |
Thank you! I was imagining different titles for different post types, but this will be good! |
How can I change the "More Fields" text?
The text was updated successfully, but these errors were encountered: