"λ λ§μ νλ" ν μ€νΈλ₯Ό μ΄λ»κ² λ³κ²½ν μ μμ΅λκΉ?
μλ‘μ΄ 'pods_meta_default_box_title' νν° μ¬μ©
νμΈ.
κ·Έλμ
add_filter('pods_meta_default_box_title','changethatname');
ν¨μ λ³κ²½μ΄λ¦($κ°) {
$value = 'λμ μ 보';
λ°ν $ κ°;
}
μλ₯Ό λ€μ΄, μλν©λλ€.
λ€λ₯Έ Podμ λν΄ λ€λ₯Έ κΈ°λ³Έ μμ μ λͺ©μ μ§μ νκΈ° μν΄ μμ λ΄μ©μ μ΄λ»κ² μμ ν μ μμ΅λκΉ?
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;
}
μ¬λ¬ κ²μλ¬Ό μ νμ λ©ν μ λͺ©μ λ³κ²½νλ μ½λλ 무μμ λκΉ?
@jaycollier
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';
}
cc @jimtrue
κ°μ¬ν©λλ€! λ€λ₯Έ κ²μλ¬Ό μ νμ λν΄ λ€λ₯Έ μ λͺ©μ μμνμ§λ§ μ΄κ²μ μ’μ κ²μ λλ€!