How can I get the standard WP-Editor through Javascript?

Ok I found the solution here Just do wp.editor.initialize(‘editor_id’, { tinymce: true, quicktags: true }); And then add buttons to the toolbar like so: jQuery( document ).on( ‘tinymce-editor-setup’, function( event, editor ) { if(editor.id !== ‘editor_id’) return; editor.settings.toolbar1 += ‘,mybutton,alignleft,aligncenter,alignright,fontselect,hr’; editor.addButton( ‘mybutton’, { text: ‘My button’, icon: false, onclick: function () { editor.insertContent(“It’s my button!”); … Read more

Limit Block format tags in WordPress wp_editor

You need to add formatselect in one of the toolbars, and WordPress by default have it in toolbar1: wp_editor( $content, ‘fm_display_callback’, array( … ‘tinymce’ => array( ‘toolbar1’ => ‘formatselect,bold,italic,…’, … ), ) ); Check this and https://www.tiny.cloud/docs-4x/configure/content-formatting/#block_formats.

Style classic editor buttons

You can add CSS to the admin area of WordPress using the [admin_head][1] hook add_action(‘admin_head’, ‘my_custom_admin_styles’); function my_custom_admin_styles() { echo ‘<style> #qt_content_center { color: red; } </style>’; } Note: Alternatively, you could add a stylesheet using the same function. Edit: Adding custom stylesheet to WP Admin. add_action( ‘admin_enqueue_scripts’, ‘load_admin_styles’ ); function load_admin_styles() { wp_enqueue_style( ‘admin-styles’, … Read more

How to make a custom field as an editor in wordpress?

Naren, The actual set-up for the classic/TinyMCE editor is relatively straightforward, I have updated your wordpress_register_fields() function with the necessary lines. For wp_editor() to work you need to get the content if there’s any saved, id the field and then provide settings arguments. (https://developer.wordpress.org/reference/functions/wp_editor/) function wordpress_register_fields() { global $post; // Nonce field to validate form … Read more

Quotes being escaped inside wp_editor when saved with wp_kses_post

WordPress always escapes quotes encountered in the super globals variables. It is done in https://developer.wordpress.org/reference/functions/wp_magic_quotes/ You will most likely want to strip it with stripslashes before saving it into the DB. something like update_option( ‘tld_wcdpue_settings_email_content’, wp_kses_post( stripslashes($_POST[‘tld_wcdpue_settings_wpeditor’] ) ));

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