Display WPForm data in a post

/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading

hide_discount_code_field_for_specific_levels

function hide_discount_code_field_for_specific_levels($show) { global $pmpro_level; if( in_array( $pmpro_level->id, array(1,2,3,4,5,6) ) ) { $show = false; } return $show; } add_filter(‘pmpro_show_discount_code’, ‘hide_discount_code_field_for_specific_levels’);Continue reading

custom_remove_userregistration_admin_bar_links

function custom_remove_ur_admin_bar_links( $wp_admin_bar ) { $wp_admin_bar->remove_menu(‘user-registration-menu’); $wp_admin_bar->remove_menu(‘ur-edit-form’); $wp_admin_bar->remove_menu(‘user-registration-all-forms’); $wp_admin_bar->remove_menu(‘user-registration-add-new’); $wp_admin_bar->remove_menu(‘user-registration-settings’); $wp_admin_bar->remove_menu(‘user-registration-docs’); } // The priority should be higher than the one used by the plugin. add_action( ‘user_registration_top_admin_bar_menu’, ‘custom_remove_ur_admin_bar_links’, 1000 );Continue reading

MemberPress: Replace Country Code with Country Name

function mepr_replace_country_code_with_country_name ( $address, $user ) { $countries = require( MEPR_I18N_PATH . ‘/countries.php’ ); $addr1 = get_user_meta( $user->ID, ‘mepr-address-one’, true ); $addr2 = get_user_meta( $user->ID, ‘mepr-address-two’, true ); $city = get_user_meta( $user->ID, ‘mepr-address-city’, true ); $state = get_user_meta( $user->ID, ‘mepr-address-state’,…Continue reading

AS Upsell – March 28 2024

function as_upsell_shortcode() { $product_ids = array(18516, 31026, 31016,33988,34011,34017,51689,5179,51682,51684); // Updated product IDs ob_start(); echo ‘ ‘; echo ‘ ‘; foreach ($product_ids as $product_id) { $product = wc_get_product($product_id); if ($product) { echo ‘ ‘; // Image container echo ‘ ‘; echo…Continue reading

Net Price Display 27/03/2024

function display_custom_prices_table_inside_additional_information_tab() { global $product; if (current_user_can(‘shop_manager’) || current_user_can(‘administrator’)) { if (is_product()) { $table_content = ”; $total_profit = 0; $total_net_price = 0; $total_current_price = 0; $table_content .= “ Profit / Loss Sheet Product SKU Net Price Current Price RRP Price…Continue reading

Net Price Display 27/03/2024

function display_custom_prices_table_inside_additional_information_tab() { global $product; if (current_user_can(‘shop_manager’) || current_user_can(‘administrator’)) { if (is_product()) { $table_content = ”; $total_profit = 0; $total_net_price = 0; $total_current_price = 0; $table_content .= “ Profit / Loss Sheet Product SKU Net Price Current Price RRP Price…Continue reading

Next Day Delivery Timer 27/03/2024

function custom_countdown_timer() { date_default_timezone_set(‘Europe/London’); // Ensure the correct timezone is set // Get current day and time $current_day = date(‘w’); // 0 (for Sunday) through 6 (for Saturday) $current_hour = date(‘G’); $start_countdown = false; // Default state is to not…Continue reading

Exclude Posts & Pages from Search

/** * Exclude Post Type from Search */ add_action(‘init’, ‘excludePostTypeFromSearch’, 99); function excludePostTypeFromSearch(){ global $wp_post_types; if(post_type_exists(‘post’) && isset($wp_post_types[‘post’])){ $wp_post_types[‘post’]->exclude_from_search = true; } if(post_type_exists(‘page’) && isset($wp_post_types[‘page’])){ $wp_post_types[‘page’]->exclude_from_search = true; } }Continue reading