function ideapro_remove_wpadmin_menus() { global $current_user; $users = array(3,4,5); $role = $current_user->roles[0]; if($current_user->ID == 1) { } elseif($role == “editor” || $role == “subscriber” || $role == “author”) { remove_menu_page(‘themes.php’); remove_menu_page(‘plugins.php’); remove_menu_page(‘edit.php?post_type=page’); remove_menu_page(‘edit.php?post_type=popup’); remove_menu_page(‘edit.php?post_type=project’); remove_menu_page(‘index.php’); remove_menu_page(‘users.php’); remove_menu_page(‘tools.php’); remove_menu_page(‘upload.php’); remove_menu_page(‘edit.php’); remove_menu_page(‘edit-comments.php’); remove_menu_page(‘options-general.php’);…Continue reading
add_filter( ‘aioseo_sitemap_posts’, ‘aioseo_sitemap_posts’ ); function aioseo_sitemap_posts( $entries ) { foreach ( $entries as $key => $entry ) { $postId = url_to_postid( $entry[‘loc’] ); if ( $postId && ( strpos($entry[‘loc’], ‘/member/’) ) ) { unset( $entries[ $key ] ); } }…Continue reading
/* Source: https://rudrastyh.com/wordpress/quick-edit-featured-image.html */ add_filter(‘manage_post_posts_columns’, ‘misha_featured_image_column’); function misha_featured_image_column( $column_array ) { // I want to add my column at the beginning, so I use array_slice() // in other cases $column_array[‘featured_image’] = ‘Featured Image’ will be enough $column_array = array_slice( $column_array,…Continue reading
add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { if (strpos($_SERVER[‘REQUEST_URI’],’/home-search/listing/’) !== false) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’?’) !== false){ $url = substr( $url, 0, strpos($url,’?’) ); } } return $url; }Continue reading
function wpcode_custom_modified_column_register( $columns ) { $columns[‘last_modified’] = __( ‘Last Modified’, ‘wpcode’ ); return $columns; } add_filter( ‘manage_edit-post_columns’, ‘wpcode_custom_modified_column_register’ ); function wpcode_custom_modified_column_display( $column_name, $post_id ) { if ( ‘last_modified’ != $column_name ) return; echo the_modified_date(); } add_action( ‘manage_posts_custom_column’, ‘wpcode_custom_modified_column_display’, 10, 2…Continue reading
function wpcode_custom_remove_admin_menus(){ // Replace “user_role” with the user role you want to target. if ( ! current_user_can( ‘user_role’) ) { return; } // Hide the comments page. remove_menu_page( ‘edit-comments.php’ ); // Hide WooCommerce page. remove_menu_page( ‘woocommerce’ ); // Hide the…Continue reading
function wpcode_custom_hide_plugins() { // Replace “administrator” with the user role you want to target. if ( ! current_user_can( ‘administrator’ ) ) { return; } // Modify the array to match the plugins you want to hide. $plugins_to_hide = array( ‘plugin-slug/plugin-file.php’,…Continue reading
add_filter( ‘aioseo_description’, ‘aioseo_filter_description’ ); function aioseo_filter_description( $description ) { if ( strlen($description) > 160 ) { $description = substr($description, 0, 159); } return $description; }Continue reading
add_filter( ‘aioseo_title’, ‘aioseo_filter_title’ ); function aioseo_filter_title( $title ) { if ( strlen($title) > 60 ) { $title = substr($title, 0, 60); } return $title; }Continue reading