/* 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_action(‘admin_init’, ‘my_acf_update_bidirectional_posts’); function my_acf_update_bidirectional_posts(){ // bail early if ajax request if(wp_doing_ajax()){ return; } // Retrieve all pages $get_posts = get_posts(array( ‘post_type’ => ‘page’, ‘posts_per_page’ => -1, ‘fields’ => ‘ids’, )); // Bail early if not found if(empty($get_posts)){ return; } //…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 duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
function wpcode_snippet_replace_howdy( $wp_admin_bar ) { // Edit the line below to set what you want the admin bar to display intead of “Howdy,”. $new_howdy = ‘Welcome ‘; $my_account = $wp_admin_bar->get_node( ‘my-account’ ); $wp_admin_bar->add_node( array( ‘id’ => ‘my-account’, ‘title’ => str_replace(…Continue reading
// Add custom css: quick buttons and accordion at the top of the GravityWP – CSS Selector modal function my_custom_gwp_css_selector_add_css() { $html .= “<!– Custom CSS 2nd Custom CSS –> Custom CSS Section Font Smaller (90%) Section Font Smaller (75%)…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
// Add custom css: quick buttons and accordion at the top of the GravityWP – CSS Selector modal function my_custom_gwp_css_selector_add_css() { $html .= “ Custom CSS Section Font Smaller (90%) Section Font Smaller (75%) Gravity PDF GravityPDF Page Break GravityPDF…Continue reading