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

WC Vendors Activate All Inactive Vendors

/** Activates all Vendor Stores **/ function wcv_activate_all_vendors() { global $wpdb; $vendors = get_users( array( ‘fields’ => array( ‘ID’ ), ‘role’ => ‘Vendor’ ) ); $meta_key = ‘_wcv_vendor_status’; foreach($vendors as $vendor){ $wpdb->query($wpdb->prepare(“UPDATE wp_usermeta SET meta_value=’active’ WHERE user_id=$vendor->ID AND (meta_key=’$meta_key’ AND…Continue reading

Add A Default Campaign Custom Amount

add_filter( ‘charitable_session_donation_amount’, ‘example_get_donation_amount_in_session’, 999, 2 ); function example_get_donation_amount_in_session( $amount = false, $campaign = false ) { // If the donation amount is not set in the session, return the default amount. // WARNING: Setting a default amount here will override…Continue reading

Remove image link from media uploads

/* Remove image link from media uploads */ function wpb_imagelink_setup() { $image_set = get_option( ‘image_default_link_type’ ); if ($image_set !== ‘none’) { update_option(‘image_default_link_type’, ‘none’); } } add_action(‘admin_init’, ‘wpb_imagelink_setup’, 10);Continue reading