jquery UI in wordpress admin

This is what I include in my calendar plugin: // Alternative solution for loading scripts only in plugin page if( (is_admin() ) && (isset($_GET[‘page’]))) { // Register scripts and styles add_action(‘admin_init’, ‘wp_eventcal_init’); } function wp_eventcal_init() { // Only load these scripts in Admin wp_deregister_script(‘jquery-ui-core’); wp_register_script(‘jquery-ui’,’http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js’,array(‘jquery’)); wp_enqueue_script(‘ui-datepicker’, plugins_url(‘js/jquery.ui.datepicker.min.js’,__FILE__)); wp_enqueue_script(‘ui-timepicker’, plugins_url(‘js/jquery.timepicker.js’,__FILE__)); wp_enqueue_script(‘wp-calendar’, plugins_url(‘js/wp-eventcal.js’,__FILE__)); wp_enqueue_style(‘event_cal_css’, plugins_url(‘styles/eventcal.css’,__FILE__)); } Then … Read more

How to disable admin flyout menus?

It’s a bit of a workarround but here you go: function remove_flyout() { echo ‘<style type=”text/css”> .js #adminmenu .wp-submenu.sub-open { display: none; } </style>’; } add_action(‘admin_head’, ‘remove_flyout’); Put it in your functions.php

Hide username from users list

There are no direct filters using which we can change the content of Name column. So to get what you want, we should remove ‘Name’ column too and create our own Name column. Therefore, modify_user_columns function will be like this function modify_user_columns($column) { $column = array( “cb” => “<input type=\”checkbox\” />”, “wdm_name” => __(‘Name’), “email” … Read more

Disable sticky posts feature

In addition to CSS you could try to unstick each post as soon as it has been made sticky (untested): add_action( ‘post_stuck’, function( $post_id ) { unstick_post( $post_id ); } ); If you’re looking for another approach, than hiding it from the UI with CSS, then consider using custom post types instead of the post … Read more

Unwanted redirect in admin area

I solved it with the help of a colleagues of mine by adding the following lines into wp-config.php: $_SERVER[‘HTTP_HOST’] = $_SERVER[‘HTTP_X_FORWARDED_HOST’]; $_SERVER[‘REQUEST_URI’] = ‘/stuff/wordpress’ . $_SERVER[‘REQUEST_URI’]; $_SERVER[‘SCRIPT_NAME’] = ‘/stuff/wordpress’ . $_SERVER[‘SCRIPT_NAME’]; $_SERVER[‘PHP_SELF’] = ‘/stuff/wordpress’ . $_SERVER[‘PHP_SELF’]; $_SERVER[‘REMOTE_ADDR’] = $_SERVER[‘HTTP_X_FORWARDED_FOR’];

Is there a way to submit only meta box content in Post edit page

IMO, it’s much better to solve this with Ajax. Maybe it’s possible the way you’re proposing, but it seems a bit confusing from an User Experience perspective: two similar buttons that do different things. What if the user modifies the content and the custom fields, updates one and loses the other? Maybe the save_post action … Read more