add_action(‘admin_notices’, ‘check_for_duplicate_full_names’); function check_for_duplicate_full_names() { $screen = get_current_screen(); // Check if we are on the Users page if ($screen->id !== ‘users’) { return; } global $wpdb; // SQL query to find duplicate first and last names $query = “SELECT meta_value…Continue reading
/** * Plugin Name: Shop Manager To-Do List * Description: Adds a custom to-do list feature for shop managers in the WordPress admin. * Version: 1.0 * Author: Your Name */ // Register custom post type for To-Dos function create_todo_post_type()…Continue reading
// Delete Expired Coupons that have an expiration date set and are not from AutomateWoo add_action(‘delete_expired_coupons_hook’, ‘delete_expired_coupons_action’); function delete_expired_coupons_action() { $query_args = [ ‘fields’ => ‘ids’, ‘post_type’ => ‘shop_coupon’, ‘post_status’ => ‘any’, ‘posts_per_page’ => -1, ‘orderby’ => ‘date’, ‘order’ =>…Continue reading
add_filter( ‘manage_posts_columns’, function ( $columns ) { // You can change this to any other position by changing ‘title’ to the name of the column you want to put it after. $move_after = ‘title’; $move_after_key = array_search( $move_after, array_keys( $columns…Continue reading
// Hide the admin ‘Screen Options’ tab add_filter(‘screen_options_show_screen’, ‘__return_false’);Continue reading
/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading
add_action( ‘admin_init’, function () { // Get all public post types $post_types = get_post_types( array(), ‘names’ ); function wpcode_add_post_id_column( $columns ) { $columns[‘wpcode_post_id’] = ‘ID’; // ‘ID’ is the column title return $columns; } function wpcode_show_post_id_column_data( $column, $post_id ) {…Continue reading
function prevent_plugin_update( $value ) { if ( isset( $value ) && is_object( $value ) ) { unset( $value->response[‘willers/willers.php’] ); } return $value; } add_filter( ‘site_transient_update_plugins’, ‘prevent_plugin_update’ );Continue reading
/* Modify the admin footer text */ add_filter( ‘admin_footer_text’, ‘rd_modify_admin_footer’ ); function rd_modify_admin_footer () { echo ‘Website designed and developed by Rubber Duckers | [email protected]‘; }Continue reading
/* Replace logo in admin bar */ add_action(‘wp_before_admin_bar_render’, ‘rd_admin_bar_logo’); function rd_admin_bar_logo() { global $wp_admin_bar; echo ‘ ‘; }Continue reading