/* 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
add_action( ‘init’, function() { if ( function_exists( ‘aioseo’ ) ) { aioseo()->preUpdates->createCacheTable(); } });Continue reading
add_filter( ‘aioseo_schema_woocommerce_shipping_disable’, ‘__return_true’ );Continue reading