How can i add some static text above the editor?

The best way would be using JavaScript to inject the element. Here’s the gist of the markup for that page: <div id=”poststuff”> <div id=”post-body” class=”metabox-holder columns-2″> <div id=”post-body-content”> <div id=”titlediv”> … other stuff … </div> <div id=”postdivrich” class=”postarea”> … other stuff … </div> </div> </div> </div> The titlediv is the title. The postdivrich is the … Read more

How to edit posts with the new wp_editor api?

For the sake of completeness, I am going to post an answer based on the solution you edited in your question. $post = get_post( $post_id, ‘OBJECT’ ); wp_editor( esc_html( $post->post_content ), ‘textarea01’, $settings ); This would escape the HTML too so if you are editing a post you might want to replace the last line … Read more

Are there ways to make the Gutenberg editor wider? And the HTML-block higher?

You have to enqueue first the style editor css function legit_block_editor_styles() { wp_enqueue_style( ‘legit-editor-styles’, get_theme_file_uri( ‘/style-editor.css’ ), false, ‘2.3’, ‘all’ );} add_action( ‘enqueue_block_editor_assets’, ‘legit_block_editor_styles’ ); Then you have to create that style-editor.css file inside your theme and then add this inside that file: .wp-block { max-width: 100%;}

Disable WYSIWYG editor only when creating a page

The best way to do this is by adding ‘user_can_richedit’ filter, like so: add_filter( ‘user_can_richedit’, ‘patrick_user_can_richedit’); function patrick_user_can_richedit($c) { global $post_type; if (‘page’ == $post_type) return false; return $c; } Hope it’s useful 😉

How to add multiple buttons to TinyMCE?

First add your additional buttons inside the buttons callback.. function register_button($buttons) { array_push($buttons, “quote”,”wpse-rules”); return $buttons; } Then add additional buttons function inside the plugin javascript.. init : function(ed, url) { ed.addButton(‘quote’, { title : ‘Add a Quote’, image : url+’/image.png’, onclick : function() { ed.selection.setContent(‘[quote]’ + ed.selection.getContent() + ‘[/quote]’); } }); ed.addButton(‘wpse-rules’, { title … Read more

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