كيف يمكنني تغيير نص "المزيد من الحقول"؟
استخدم مرشح "pods_meta_default_box_title" الجديد
نعم.
وبالتالي
add_filter ('pods_meta_default_box_title'، 'changethatname') ؛
وظيفة changethatname (قيمة $) {
$ value = "تفاصيل الراقص" ؛
إرجاع قيمة $؛
}
على سبيل المثال ، يعمل.
كيف يمكننا تعديل ما ورد أعلاه لتحديد عناوين مربعات افتراضية مختلفة لبودات مختلفة؟
srikat - ربما تكون قد نجحت في ذلك بالفعل ولكن أتمنى أن يجد شخص آخر هذا مفيدًا:
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;
}
ما هو رمز تغيير العناوين الوصفية لأنواع منشورات متعددة؟
تضمين التغريدة
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.
*
* <strong i="7">@param</strong> string $title The title to use, default is 'More Fields'.
* <strong i="8">@param</strong> obj|Pods $pod Current Pods Object.
* <strong i="9">@param</strong> array $fields List of fields that will go in the metabox.
* <strong i="10">@param</strong> string $type The type of Pod.
* <strong i="11">@param</strong> string $name Name of the Pod.
*
* <strong i="12">@return</strong> string The title for the metabox.
*
* <strong i="13">@since</strong> 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';
}
ccjimtrue
شكرا لك! كنت أتخيل عناوين مختلفة لأنواع منشورات مختلفة ، لكن هذا سيكون جيدًا!