Last active
July 27, 2016 06:36
-
-
Save developer-anuragsingh/1a8893ec9606234dc2b4249af0eee5ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Change the featured image metabox title text | |
*/ | |
function as_change_featured_image_metabox_title() { | |
remove_meta_box( 'postimagediv', 'YOUR_POST_TYPE', 'side' ); | |
add_meta_box( 'postimagediv', __( 'Header Background Image', 'as' ), 'post_thumbnail_meta_box', 'YOUR_POST_TYPE', 'side' ); | |
} | |
add_action('do_meta_boxes', 'as_change_featured_image_metabox_title' ); | |
/* | |
* Change the featured image metabox link text | |
* | |
* @param string $content Featured image link text | |
* @return string $content Featured image link text, filtered | |
*/ | |
function as_change_featured_image_text( $content ) { | |
if ( 'YOUR_POST_TYPE' === get_post_type() ) { | |
$content = str_replace( 'Set featured image', __( 'Add Header Background Image', 'as' ), $content ); | |
$content = str_replace( 'Remove featured image', __( 'Remove Header Background Image', 'as' ), $content ); | |
} | |
return $content; | |
} | |
add_filter( 'admin_post_thumbnail_html', 'as_change_featured_image_text' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment