Last active
November 23, 2017 09:56
-
-
Save thierrypigot/4132226e74b411c5c1267cdf3d36592f to your computer and use it in GitHub Desktop.
WordPress: Enables Editor in Media edit screen
This file contains 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
Besoin de support WordPress ou de maintenance WordPress ? | |
Contactez WP Assistance : https://www.wp-assistance.fr | |
<?php | |
// Enables Editor in Media edit screen. | |
add_filter( 'wp_editor_settings', 'wearewp_add_editor_support_for_attachments' ); | |
function wearewp_add_editor_support_for_attachments($settings) { | |
if( get_post_type() == 'attachment'){ | |
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,ul,ol,li,code,close' ); | |
$settings = array( | |
'wpautop' => true, | |
'textarea_name' => 'content', | |
'textarea_rows' => 10, | |
'media_buttons' => false, | |
'tinymce' => true, | |
'quicktags' => $quicktags_settings, | |
); | |
return $settings; | |
} | |
} |
<?php echo nl2br( get_the_post_thumbnail_caption() ); ?>
<?php the_post_thumbnail_caption(); ?>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Display content :
<?php echo get_post_field( 'post_content', get_post_thumbnail_id() ); ?>