Injecting pre-defined text from custom page template to editor

The code below will work, read inline comments. Paste it into your theme functions.php or plugin. The only problem with this is the it will only work when the template is selected and the post is saved/updated and the editor is blank. <?php function wpse_177576_update_editor_content( $post_id ) { if ( wp_is_post_revision( $post_id ) ) return; … Read more

How to use wordpress text editor in php page

The wordpress editor is designed to work in wordpress enviroment and there is not much point in trying to somehow make it work “outside” of wordpress. You might hack it but any wordpress upgrade might break it. You need to use your php in the wordpress context by making a page template for your theme … Read more

remove/hide wp-editor

I believe the helper you’re looking for (assuming we’re not dealing with a custom post type) is: <?php remove_post_type_support(‘page’, ‘editor’); ?> When dealing with a custom post type you can exclude ‘editor’ from the ‘supports’ parameter to initialize the post type without the editor window. Finally, if you are trying to disable the editor only … Read more

custom wp_editor does not save the content in plugin settings

Might be possible that your wp_editor is broken! According to codex you can not use numeric editor ID may only contain lowercase letters and underscores…hyphens will cause editor to not display properly Call wp_editor in this way wp_editor( $nga_textarea_field_1_invalid, ‘nga_textarea_field_one’ ); textarea_name is not required because by default it is already wp_editor ID. I am … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)