/** * Block form submissions based on IP address * * @link https://www.seoinc.com/contact-us/ */ function wpf_ip_block( $fields, $entry, $form_data ) { // Get the current users IP address $ip_address = wpforms_get_ip(); // List out the IP addresses separated by a…Continue reading
add_filter( ‘mepr-thankyou-page-url’, function( $url, $args ) { if( isset( $_POST[ ‘mepr_company_size’ ] ) && $_POST[ ‘mepr_company_size’ ] === ‘500+’ ) { return ‘https://mydomain.com/’; } return $url; }, 10, 2 );Continue reading
function mepr_exclude_sub_accounts( $atts, $content = “” ) { $user = MeprUtils::get_currentuserinfo(); if ($user === false) { return; } $ca_uuid = get_user_meta( $user->ID, ‘mpca_corporate_account_id’, true ); // If $ca_uuid has a value, in other words, not empty, then it’s a sub…Continue reading
add_shortcode( ‘mepr-membership-members’, function( $attributes ) { global $wpdb; // Check if a valid membership ID is provided if( isset( $attributes[‘id’] ) && is_numeric( $attributes[‘id’] ) ) { $membership_id = (int) $attributes[‘id’]; } else { return; // Return nothing if no…Continue reading
function wpb_copyright() { global $wpdb; $copyright_dates = $wpdb->get_results(” SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = ‘publish’ “); $output = ”; if($copyright_dates) { $copyright = “© ” . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= ‘-‘…Continue reading
add_shortcode( ‘mepr-subaccount-link’, function() { global $wpdb; $user = MeprUtils::get_currentuserinfo(); if ( ! $user ) { return; } $subaccount_link = ”; $caid = get_user_meta( $user->ID, ‘mpca_corporate_account_id’, true ); if ( empty( $caid ) ) { $query = $wpdb->prepare( “SELECT uuid FROM…Continue reading
add_shortcode(‘mpcs-unenrolled-courses’, function() { $unenrolled_courses = array(); $current_user = MeprUtils::get_currentuserinfo(); $mepr_user = new MeprUser( $current_user->ID ); $courses = get_posts( array( ‘post_type’ => ‘mpcs-course’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘-1’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ )); if (false == MeprUtils::is_logged_in_and_an_admin()) {…Continue reading
function mepr_load_course_styles( $allowed_handles ) { global $wp_styles; // Add all currently enqueued styles to the list of allowed handles foreach ( $wp_styles->queue as $style ) { $allowed_handles[] = $style; } return $allowed_handles; } // Add the filter to modify the…Continue reading
function white_label_wp_fusion( $translation, $text, $domain ) { if ( ‘wp-fusion’ === $domain ) { $translation = str_replace( ‘WP Fusion’, ‘CRM’, $translation ); } return $translation; } add_filter( ‘gettext’, ‘white_label_wp_fusion’, 10, 3 ); function wpf_whitelabel_crm( &$crm ) { $crm->name = ‘CRM’;…Continue reading
/* Plugin Name: Restaurant Hours, Shop Control & Checkout Disable (Enhanced with Vacations, Custom Notices, Dynamic Data, Close Button, Time Until Open, Admin Timezone & Shipping/Payment Disable) Description: Gestiona los horarios del restaurante (con múltiples sesiones en español) y deshabilita…Continue reading