How To Make Iris Color Picker Showed Up Over Form and Text?

I found the answer. SO, there is no need to use wordpress api to make the color picker box showed up over another elemnn/s when the ‘Select color’ button is clicked. Just add this css code to your plugin/ theme administration css file: .wp-picker-clear, div.wp-picker-holder { z-index: 999 !important; position: absolute !important; }

How to change color of registered widget areas in admin?

If you intend to style the sidebar in the backend, you do not need to do anything else. when you use the code you posted, the html created by WordPress for the sidebar contain a div with the id attribute equal to the id of the sidebar. Consider this code: function custom_colored_sidebar() { register_sidebar( array( … Read more

Sortable column containing numeric values for Custom Post Type at WordPress Backend

Try // 1. Register the column add_filter( ‘manage_edit-post_columns’, ‘price_column_register’ ); function price_column_register( $columns ) { $columns[‘price’] = __( ‘Price’, ‘theme’ ); return $columns; } // 2. Display the column content add_action( ‘manage_posts_custom_column’, ‘price_column_display’, 10, 2 ); function price_column_display( $column_name, $post_id ) { if ( ‘price’ != $column_name ) return; $price = get_post_meta($post_id, ‘price’, true); if … Read more

How to modify admin headers

Not a direct answer, but: for simple data exports on the admin side, I generally just use the AJAX API. Set up an AJAX handler for your export: /** * export from admin */ function wpse_126508_export() { header(‘Content-Type: text/xml; charset=utf-8’); header(‘Content-Description: File Transfer’); header(‘Content-Disposition: attachment; filename=wpse_126508_export.xml’); $xml = new XMLWriter(); $xml->openURI(‘php://output’); $xml->startDocument(‘1.0’, ‘UTF-8’); $xml->startElement(‘wpse_126508_export’); // … Read more

How to include a file only on dashboard widgets page?

You can use the following code. Asuming that the css file style.css is inside the css folder of your theme: function wpse_126614_enque( $hook ) { if ( ‘widgets.php’ != $hook ) { return; } $template_url = get_template_directory_uri(); wp_enqueue_style( ‘admin-style-widget’, $template_url . ‘/css/style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘wpse_126614_enque’ );

How to detect when admin user is on the All Posts page?

If you need exactly on All Posts page, Not on All Pages, nor All Products or etc – if ( ‘edit.php’ === $GLOBALS[‘pagenow’] && ( isset( $GLOBALS[‘typenow’] ) && ” == $GLOBALS[‘typenow’] || ‘post’ == $GLOBALS[‘typenow’] ) ) { // Do what you like… }

Add menu item to edit specific page

You’ve almost answered your own question. Just pass the URL as the $menu_slug to add_menu_page: add_menu_page( null, // not an actual page, so title is irrelevant ‘Menu Item Name’, ‘edit_posts’, // or whatever capability required for this object ‘/post.php?post=42&action=edit’, null, ”, 6 ); The caveat is that when you visit this menu item, the actual … Read more

Add Labels to Admin Menu ( How To )

First of all, searching with wrong keyword won’t give you any right solution. It’s a hint that, you are dealing with Admin menu, and anything under a menu drop down is called a sub menu – so you should search with something like: How to add submenu to any admin menu item + WordPress?. 🙂 … Read more

How to remove specific tag from multiple posts?

Since no direct function is there to achieve the required so I have made the code. Code is self explanatory and you can tweak it the way you like. <?php //Assuming a post ID to reset tags. $postid = 172; //Assuming tag2 is supposed to be removed $remove_tag = ‘tag2’; //Collecting all the tags of … Read more

remove all submenus from plugin

Not without touching the global $submenu directly (which I wouldn’t recommend – using only purposefully exposed APIs provides, in general, better stability). However, if you wanted a function to remove all submenus: /** * Removes all submenus of given menu item * * @param string $menu_slug The slug of the parent menu to remove submenus … Read more