check_user_role_and_redirect to 2 different url address 1

function check_user_role_and_redirect() { // Check if the user is logged in if ( is_user_logged_in() ) { // Get current user info $user = wp_get_current_user(); // Define the URLs for redirection $facebook_group_url = ‘https://www.facebook.com/groups/fs22westend64x’; $another_page_url = ‘https://levismodding.co.uk/membership-account/membership-checkout/?level=3’; // Check user roles…Continue reading

my_pmpro_confirmation_url

/** * Redirect Members to a Unique Confirmation Page Based on Membership Level * * title: Redirect Members to a Unique Confirmation Page Based on Membership Level * layout: snippet * collection: checkout * category: confirmation * * You can…Continue reading

custom_remove_happy_addons_admin_bar_link

function custom_remove_happy_addons_admin_bar_link( $wp_admin_bar ) { if ( ! current_user_can( ‘manage_options’ ) ) { return; } $wp_admin_bar->remove_menu(‘happy-addons’); } add_action( ‘admin_bar_menu’, ‘custom_remove_happy_addons_admin_bar_link’, 999 );Continue reading

custom_remove_comments_admin_bar_links

function custom_remove_comments_admin_bar_links() { global $wp_admin_bar; if ( ! method_exists( $wp_admin_bar, ‘remove_menu’ ) ) { return; // Ensures $wp_admin_bar is an object with the remove_menu method. } $wp_admin_bar->remove_menu(‘comments’); } add_action( ‘admin_bar_menu’, ‘custom_remove_comments_admin_bar_links’, 1000 );Continue reading

Add Users and Plugins to admin bar

function custom_admin_bar_links($wp_admin_bar) { // Check if the current user has the ‘manage_options’ capability if (!current_user_can(‘manage_options’)) { return; // Exit if the user is not an administrator } // Add a link to the ‘Plugins’ admin page $wp_admin_bar->add_node(array( ‘id’ => ‘admin-bar-plugins’,…Continue reading

Remove custom trial for existing members

/** * Remove custom trial for existing members (when existing member changes levels/renews) * * title: Remove custom trial for existing memebrs. * layout: snippet * collection: checkout * category: membership-levels, trial * * You can add this recipe to…Continue reading

Disable Thumbnail Image Sizes

add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading

Add Auto Sizes to Lazy Loaded images

add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if ( ! isset( $attr[‘loading’] ) || ‘lazy’ !== $attr[‘loading’] || ! isset( $attr[‘sizes’] ) ) { return $attr; } // Skip if attribute was already added. if ( false !== strpos( $attr[‘sizes’], ‘auto,’…Continue reading