How to search post by ID in wp-admin

Solution 1 Here’s a solution that uses pre_get_posts action to override the original search query and search by post ID instead. This is the approach that I would generally recommend. /** * Allows posts to be searched by ID in the admin area. * * @param WP_Query $query The WP_Query instance (passed by reference). */ … Read more

js error on post editing page

I’d suggest disabling script concatenation and/or compression to see if that helps. You can do this by adding the following to the wp-config.php file: define( ‘CONCATENATE_SCRIPTS’, false ); define( ‘COMPRESS_SCRIPTS’, false ); And maybe even script debugging to.. define( ‘SCRIPT_DEBUG’, true ); Are you using any caching plugins? EDIT: The most common reason for seeing … Read more

Add header and footer to WP backend

The in_admin_header action may be used to insert content before <div id=”wpbody”> in the wordpress backend. See Line 101 of /wp-admin/admin-header.php (line number as of version 3.3.2) Further reading on actions: Action Reference, codex

Remove “Time to upgrade” message from dashboard

How to hide WordPress update mesages CSS The low-tech way to hide something is using css: // Low-tech hiding of update-mesages // source: http://wpsnipp.com/index.php/functions-php/hide-update-nag-within-the-admin/ function remove_upgrade_nag() { echo ‘<style type=”text/css”> .update-nag {display: none} </style>’; } add_action(‘admin_head’, ‘remove_upgrade_nag’); This more-or-less works, but it is a lot of work to find al the places WordPress shows messages. … Read more

How to remove comments option from wp-admin bar and modify profile icon

To remove the comments menu from the top admin bar you can use the $wp_admin_bar global and the remove_menu() method like this: function my_admin_bar_render() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘comments’); } add_action( ‘wp_before_admin_bar_render’, ‘my_admin_bar_render’ ); As for changing the icon on the settings section of the left admin menu, you can modify the dashicon that is used … Read more

How do I change the login logo URL and hover title?

Try these filters instead // changing the logo link from wordpress.org to your site function mb_login_url() { return home_url(); } add_filter( ‘login_headerurl’, ‘mb_login_url’ ); // changing the alt text on the logo to show your site name function mb_login_title() { return get_option( ‘blogname’ ); } add_filter( ‘login_headertitle’, ‘mb_login_title’ ); Though if you’re on a Network/MultiSite … Read more

Custom column for changing post status via ajax

here you go: <?php /* Plugin Name: ajaxed-status Plugin URI: http://en.bainternet.info Description: answer to : Custom column for changing post status via ajax http://wordpress.stackexchange.com/questions/33442/custom-column-for-changing-post-status-via-ajax Version: 1.0 Author: Bainternet Author URI: http://en.bainternet.info */ if ( !class_exists(‘ajaxed_status’)){ class ajaxed_status { //constarctor public function __construct() { global $pagenow,$typenow; //&& $typenow ==’page’ if (is_admin() && $pagenow==’edit.php’){ add_filter(‘admin_footer’,array($this,’insert_ajax_status_script’)); } add_filter( … Read more

wp_list_tables bulk actions

If you add a bulk-action, then you have to react on this action. Simply adding a function doesn’t do anything, you have to call it: class WPSE_List_Table extends WP_List_Table { public function __construct() { parent::__construct( array( ‘singular’ => ‘singular_form’, ‘plural’ => ‘plural_form’, ‘ajax’ => false ) ); } public function prepare_items() { $columns = $this->get_columns(); … Read more

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