Reorder plugin items in the admin menu

Try taking just the name from the page admin link and see if it works. Something like this: function custom_menu_order($menu_ord) { if (!$menu_ord) return true; return array( ‘index.php’, // Dashboard ‘separator1’, // First separator ‘edit.php’, // Posts ‘pluginname2’, // Take the name from the page menu admin.php?page=pluginname2 ‘upload.php’, // Media ‘edit.php?post_type=page’, // Pages ‘edit-comments.php’, // … Read more

Hide content-box on specific pages (in admin)?

I ended up using userabuser’s answer with a small modification, because global $post doesn’t seem to exist on init. You can instead just query for post in querystring, like so: function remove_editor() { if (isset($_GET[‘post’])) { $id = $_GET[‘post’]; $template = get_post_meta($id, ‘_wp_page_template’, true); if($template == ‘template_name.php’){ remove_post_type_support( ‘page’, ‘editor’ ); } } } add_action(‘init’, … Read more

Change post title during post saving process

You can hook into wp_insert_post_data and change things. <?php add_filter(‘wp_insert_post_data’, ‘wpse67262_change_title’); function wpse67262_change_title($data) { $data[‘post_title’] = ‘This will change the title’; return $data; } Obviously you’re going to have to some checks and stuff so you don’t change every post title. That hook will also fire every time the post is saved (adding a new … Read more

Make certain pages uneditable by editors?

You can try the map_meta_cap filter: /** * Uneditable posts/pages for editors */ add_filter( ‘map_meta_cap’, function ( $caps, $cap, $user_id, $args ) { // Edit to your needs: $post_ids = [123, 234, 345, 456]; // Uneditable posts $role=”editor”; // Uneditable by this user role // Make given posts uneditable for the above user role: if … Read more

Customize Admin Users Screen based on Role

Manage Columns It’s pretty straight forward using the manage_{post-type-name}_columns filter: Just switch per $capability and unset what you don’t need in the $post_columns array. function wpse19435_manage_columns( $posts_columns ) { // First role: add a column – take a look at the second function if ( current_user_can( $capability_admin ) ) { $posts_columns[‘some_column_name’] = _x( ‘Whatever’, ‘column … Read more

Blocking Administrative Access to Authors and Subcribers?

Create a functionality plugin and use this if you want to completely block the access to the Admin panel: /** * Hide the admin bar in the front end */ add_filter(‘show_admin_bar’, ‘__return_false’); /** * Redirects Authors and Subscribers to the site front page using: get_home_url() */ add_action(‘admin_init’,’block_users_wpse_53675′); function block_users_wpse_53675() { if( !current_user_can( ‘delete_pages’ ) ) … Read more

Enqueue jQuery UI Tabs In Admin Area

I normally load it as a dependancy of my plugin’s js file like so: if ( is_admin() ) { //load my plugin’s js add_action(‘admin_print_scripts’, ‘my_plugin_load_js’ ); } function my_plugin_load_js() { $plugin_js = WP_PLUGIN_URL . “https://wordpress.stackexchange.com/” . plugin_basename( dirname(__FILE__) ) . ‘/my-plugin.js’; wp_enqueue_script(‘my-plugin-js’, $plugin_js, array(‘jquery-ui-tabs’), ‘1.0’); }

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