Custom taxonomy admin description

I don’t know of any hooks to add or filter the metabox so you can either create your own metabox to replace the custom taxonomy metabox or in this case just use JQuery .append() for example is your taxonomy is named banners and its none – hierarchical (like tags) then: $(‘.tagsdiv-banners’).append(‘<p>your short description here</p>’); and … Read more

“Automatically add new top-level pages” Default

<?php add_action( ‘wp_create_nav_menu’, ‘PREFIX_nav_menu_auto_add_by_default’ ); function PREFIX_nav_menu_auto_add_by_default( $id ) { $options = (array) get_option( ‘nav_menu_options’ ); if ( ! isset( $options[‘auto_add’] ) ) { $options[‘auto_add’] = array(); } $options[‘auto_add’][] = $id; update_option( ‘nav_menu_options’, $options ); }

Reference external file as a function

You can’t. Create a function that loads that file: function load_admin_page_file() { require ‘admin-members.php’; } Then use that function name as callback argument. In PHP 5.3 you can use a lambda: add_menu_page( ‘Members’, ‘Members’, ‘manage_options’, ‘members’, function() { require ‘admin-members.php’; } );

WordPress 3.8 get current admin color scheme

I actually made it! In my script file, at the to I define a new variable and copy the $_wp_admin_css_colors variable into it using the admin_head hook, since the variable gets destroyed at some later point: <?php global $admin_colors; // only needed if colors must be available in classes add_action(‘admin_head’, function() { global $_wp_admin_css_colors; global … Read more

Wrong url in sortable column headers & pagination in the admin, when behind a proxy

Ok so apparently this site is behind a firewall or proxy. On lines 491 and 658 in wp-admin/includes/class-wp-list-table.php, replace this line $current_url = ( is_ssl() ? ‘https://’ : ‘http://’ ) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; with if(!empty($_SERVER[‘HTTP_X_FORWARDED_HOST’])){ $hostname = $_SERVER[‘HTTP_X_FORWARDED_HOST’]; } else { $hostname = $_SERVER[‘HTTP_HOST’]; } $current_url = ( is_ssl() ? ‘https://’ : ‘http://’ ) … Read more

How to Remove the “Restore” Link in Quick Edit?

This will do: add_filter(‘post_row_actions’, ‘wpse_56560_remove_untrash’, 10, 2); add_filter(‘page_row_actions’, ‘wpse_56560_remove_untrash’, 10, 2); function wpse_56560_remove_untrash( $actions, $post ) { if( !isset( $actions[‘untrash’] ) ) return $actions; // If NOT administrator, remove Untrash if( !current_user_can(‘administrator’) ) unset( $actions[‘untrash’] ); return $actions; }

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