Add quicktag buttons to the HTML editor
Download and install HTML Editor Reloaded Plugin and go to setting pages and you can add your own new buttons. http://wordpress.org/extend/plugins/html-editor-reloaded/
Download and install HTML Editor Reloaded Plugin and go to setting pages and you can add your own new buttons. http://wordpress.org/extend/plugins/html-editor-reloaded/
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
As it doesn’t look as though the OP is coming back, I’m adding their answer as an answer rather than leaving it in the question: For everyone dealing with the same problem: I was able to fix it with a code snippet of another thread: https://wordpress.stackexchange.com/a/172556/87321 Just had to add the post status “pending”, so … Read more
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
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%;}
You could do like this: function image_tag_class($class) { $class .= ‘ my-custom-class’; return $class; } add_filter(‘get_image_tag_class’, ‘image_tag_class’ ); in case you wanna know more about actions and hooks. Difference Between Filter and Action Hooks? add_filter add_action
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 😉
I think this small source code is your solution. It currently doesn’t have frontend feedback for the Sticky Post change, but you can enhance this string, class or whatever you want in the function fb_stick_post. The first function adds the item in the Admin Bar and creates a new Url with a param value. Also, … Read more
From the comments, problems seems to be related to some plugin misbehaving.
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