Location: everywhere
custom_tawkto_user_info_js 1
function custom_tawkto_user_info_js() { // Check if the user is logged in if (is_user_logged_in()) { // Get the current user’s information $current_user = wp_get_current_user(); // Output the user’s name and email in JavaScript variables echo ” “; } } // Hook…Continue reading
No login errors
function no_wordpress_errors(){ return ‘Something is wrong!’; } add_filter( ‘login_errors’, ‘no_wordpress_errors’ );Continue reading
Webinar popup home page
Allow SVG Files Upload (copy)
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
Disable purchase
add_filter( ‘woocommerce_is_purchasable’, ‘__return_false’ );Continue reading
Untitled Snippet
add_action( ‘plugins_loaded’, ‘ht_force_header_for_site_search_spam’ ); /** * Targets common search spam queries and sets a 410 Gone header * to get them out of Google Search Console. * * @since 1.0.0 */ function ht_force_header_for_site_search_spam() { // If we can’t find the…Continue reading
redirect_non_access_users_to_donation_page
function redirect_non_access_users_to_donation_page() { // Check if we are on a singular page and it’s not the admin area if (!is_admin() && is_singular()) { global $post; // Check if the current user has access to the post if (function_exists(‘pmpro_has_membership_access’)) { $has_access…Continue reading
custom_single_page_role_based_redirection fs22 westend fs22 westend patreon
function custom_single_page_role_based_redirection() { // Check if not in the admin section and the user is on a page if (is_admin() || !is_page()) { return; } // Member roles for this specific redirection $member_roles = [‘silverdonator’, ‘golddonator’, ‘platinumdonator’, ‘titanium_donator’]; // Non-member…Continue reading
pmpro_admin_access_override administrator have access to every page
function pmpro_admin_access_override($hasaccess, $post, $user, $levels) { // Check if the current user has the ‘administrator’ role if (current_user_can(‘administrator’)) { // Grant access return true; } // Return the original access decision for non-admins return $hasaccess; } add_filter(‘pmpro_has_membership_access_filter’, ‘pmpro_admin_access_override’, 10, 4);Continue reading