How to add button to post page WordPress 5.x
How to add button to post page WordPress 5.x
How to add button to post page WordPress 5.x
note that wp_editor will echo to output, not put it in a variable. If you want to put it in a variable, just do ob_start(); wp_editor($content, ‘textarea_rich’, $args); $html = ob_get_contents(); ob_end_clean(); and you have what you need in $html. You can also see https://plugins.svn.wordpress.org/indypress/tags/1.0/indypress/form_inputs/tinymce.php for a working implementation. Another issue I noted is some … Read more
First things first, modifying core files is extremely frowned upon you will have to make these changes with every upgrade and they can lead to security and other problems. I’m pretty sure there is a plugin that will allow this. I did a simple search and here are a few to try: http://wordpress.org/extend/plugins/preserved-html-editor-markup/ http://wordpress.org/extend/plugins/ultimate-tinymce/
Quick hack to get the job done, in case anyone else needs to do this: add_action(‘add_meta_boxes’, function() { add_action(‘admin_head’, function() { echo <<<EOS <style type=”text/css”> #visibility { display: none; } </style> EOS; }); }); add_action(‘restrict_manage_posts’, function() { echo <<<EOS <script type=”text/javascript”> jQuery(document).ready(function($) { $(“input[name=”keep_private”]”).parents(“div.inline-edit-group:first”).hide(); }); </script> EOS; }); (Still curious to know if there’s a … Read more
Thanks for the hint Bainternet, indeed this is very easy to implement with jQuery. Example (the four meta boxes are closed for clarity) : Here’s what I did : var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“#side-sortables”).append(‘<div id=”container_div” class=”postbox meta-box-sortables ui-sortable”><div class=”handlediv” title=”Click to toggle.”><br></div><h3 class=”hndle”><span>Container Meta Box</span></h3><div id=”container_inside” class=”inside”></div></div>’); $j(“#my_metabox_div”).appendTo(“#container_inside”); $j(“#my_other_metabox_div”).appendTo(“#container_inside”); etc… }); I added … Read more
Here’s a small screenshot of what this code produces: Demo Editor is a new user i added with Editor status and then logged in as Demo Editor and modified a post to test this solution works. You can create a custom template tag in your child theme like this and add the template tag in … Read more
Agreed, I’ve seen it too, but I don’t think there’s any readily available API or method. For me, I use a lick of jQuery; <input type=”text” class=”list-item” name=”list_items[]” /> <input type=”button” class=”button-secondary” id=”add-list” /> <script type=”text/javascript”> ( function( $ ) { $( ‘#add-list’ ).click( function() { var $item = $( ‘.list-item:last’ ), $new = $item.clone(); … Read more
This will be possible in the upcoming version WordPress 3.4. Try the Beta or just wait. Here is a screen shot (incomplete translation to German):
To disable the inline link tool and revert it back to a pop-up screen instead, do the following: In your child theme directory, add the following to your function.php: add_filter( ‘mce_external_plugins’, ‘wpse_236590_link_editor’ ); function wpse_236590_link_editor( $plugins ) { $plugins[‘full_link_dialog’] = plugins_url( ‘js/’, __FILE__ ) . ‘editor.js’; return $plugins; } Next create a directory inside your … Read more
It appears to be a bug, but one that can be hacked around each time it happens with about 2 seconds of work. This wordpress forum thread: If you’re using Chrome, right-click on the greyed-out “Update” button and select “Inspect Element”. You will see something to the likes of: <input name=”save” type=”submit” class=”button button-primary button-large … Read more