How to Make admin Sidebar Menu always be Collapse by code

To make the admin sidebar menu always be collapsed, try adding the following code in the functions.php file of your child theme, or add it in your site using a plugin like Code Snippets, or Add Actions and Filters. global $user_ID; $user_fold = get_user_meta( $user_ID, ‘wp_user-settings’, true ); $exp_array = explode( “&”, $user_fold ); $search_array … Read more

Adding TinyMCE custom buttons when using teeny_mce_before_init

I believe that you have already registered your shortcode. Now what we need to do is to initiate the Button. Once the shortcode is registered [ph_min] let’s check if user can use rich editing: function add_highlight_button() { if ( ! current_user_can(‘edit_posts’) && ! current_user_can(‘edit_pages’) ) return; if ( get_user_option(‘rich_editing’) == ‘true’) { add_filter(‘mce_external_plugins’, ‘add_tcustom_tinymce_plugin’); add_filter(‘mce_buttons’, … Read more

Custom Shortcode and Button not Working after 3.9 update

Try like this: <script type=”text/javascript”> tinymce.init({ selector: “textarea”, toolbar: “mybutton”, setup: function(editor) { editor.addButton(‘mybutton’, { type: ‘splitbutton’, text: ‘My button’, icon: false, onclick: function() { editor.insertContent(‘Main button’); }, menu: [ {text: ‘Menu item 1’, onclick: function() { tinyMCE.activeEditor.execCommand(“myPopup”, false, { title: ‘Divider’, identifier: ‘divider’ })}}, {text: ‘Menu item 2’, onclick: function() {editor.insertContent(‘Menu item 2’);}} ] … Read more

Custom “Publish” / “Update” button &

You can stimulate click to Update post button like this.. Adding submit or update button to custom metabox? <script> jQuery(‘.metabox_submit’).click(function(e) { e.preventDefault(); jQuery(‘#publish’).click(); }); </script> <input type=”submit” class=”metabox_submit” value=”Submit” />

Adding submit or update button to custom metabox?

Don’t know if i agree with EarnestoDev answer which is more of an opinion then an answer based on facts and not true in all cases, since you can use jQuery to trigger the submit event when a different element is clicked, so just add this js code once <script> jQuery(‘.metabox_submit’).click(function(e) { e.preventDefault(); jQuery(‘#publish’).click(); }); … Read more