Support » Plugins » Hacks » relabel "Featured Image" on custom type

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are ready to write some code, I believe that the filter ‘admin_post_thumbnail_html’ can do what you want.

    You can look how WordPress outputs the metabox by looking at the function ‘_wp_post_thumbnail_html’ in the file wp-admin/includes/post.php

    I found this too.

    Thread Starter Shasta

    (@shastaw)

    Thank you Chouby. The linked article helped me figure out how to change the link-text on only the one custom type lit_bookinfo:

    add_action('admin_head-post-new.php',change_thumbnail_html);
    add_action('admin_head-post.php',change_thumbnail_html);
    function change_thumbnail_html( $content ) {
        if ('lit_bookinfo' == $GLOBALS['post_type'])
          add_filter('admin_post_thumbnail_html',do_thumb);
    }
    function do_thumb($content){
    	 return str_replace(__('Set featured image'), __('Book Cover'),$content);
    }

    I haven’t found a way to change the actual title of the metabox except to use jQuery. I’m not sure why that seems so wrong … I may still choose to do that if I decide this is still confusing for authors.

    I’m going to leave this open for now in case anyone knows how to change the title of the metabox.

    An alternative to JQuery for the title would be to access directly to the variable containing the title.

    It should be in the global variable $wp_meta_boxes at the index $wp_meta_boxes[‘post’][‘side’][‘low’][‘postimagediv’][‘title’]

    Replacing ‘post’ by your post type should be OK I guess

    Robert

    (@redrings)

    @shastaw – Thanks! That is exactly what I’ve been looking for. I found out how to change the actual title of the metabox:

    add_action('do_meta_boxes', 'change_image_box');
    function change_image_box()
    {
        remove_meta_box( 'postimagediv', 'custom_post_type', 'side' );
        add_meta_box('postimagediv', __('New Text'), 'post_thumbnail_meta_box', 'custom_post_type', 'normal', 'high');
    }

    custom_post_type should be the custom post type you want it to appear on
    New Text is the text you want to replace ‘Featured Image’

    Note: Above code also moves the featured image box from the side to area under the editor.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘relabel "Featured Image" on custom type’ is closed to new replies.