Placeholder in HTML editor text area?

I am trying to make a placeholder appear on the default html editor on a specific post type.
The code looks like this:

function add_placeholder_event( $html ){
if ( ‘event’ == $post->post_type )
$html = preg_replace(‘/<textarea/’, ‘<textarea placeholder=”my place holder text” ‘, $html);
return $html;

It does not work, however, if I remove if ( ‘event’ == $post->post_type ) from the code it will work (but will apply to every html text editor on WordPress).

Any idea what I am doing wrong?

Read more here:: Placeholder in HTML editor text area?

Leave a Reply

Your email address will not be published. Required fields are marked *