function mepr_email_user_role_change( $user_id, $new_role ) { $site_url = get_bloginfo( ‘wpurl’ ); $user_info = get_userdata( $user_id ); $to = $user_info->user_email; $subject = “Your role has changed: “.$site_url; // Email Subject $message = “Hello ” .$user_info->display_name . “, your role has changed…Continue reading
// Update Vendor and Venue Posts // Update existing post title, content, author and custom fields with values from Gravity Forms. class GW_Update_Posts { protected $_args; public function __construct( $args = array() ) { // Set our default arguments, parse…Continue reading
/** // * Gravity Wiz // Gravity Forms // Update Posts // * https://gravitywiz.com/how-to-update-posts-with-gravity-forms/ // * // * Update existing post title, content, author and custom fields with values from Gravity Forms. // * // * @version 0.6 // *…Continue reading
/* Get vendor post ID by user ID */ function get_vendor_post_id_by_user( $user_id ) { $args = array( ‘post_type’ => ‘vendor’, ‘author’ => $user_id, ‘post_status’ => array( ‘publish’, ‘pending’, ‘draft’ ), ‘numberposts’ => 1, ‘fields’ => ‘ids’, ); $vendor_posts = get_posts(…Continue reading
if(!function_exists(‘wp_get_attachment’) ) : function wp_get_attachment( $attachment_id ) { $attachment = get_post($attachment_id); if( $attachment ) { $caption = function_exists(‘aioseoImageSeo’) ? aioseoImageSeo()->tags->replaceTags(aioseo()->options->image->caption->format, $attachment->ID, ‘caption’) : $attachment->post_excerpt; return array( ‘alt’ => get_post_meta($attachment->ID, ‘_wp_attachment_image_alt’, true), ‘caption’ => $caption, ‘description’ => $attachment->post_content, ‘href’ => esc_url(get_permalink($attachment->ID)),…Continue reading
// Description: // This script processes vendor and venue profile claims upon user activation in WordPress, leveraging Gravity Forms activation hooks. It normalizes business names for consistency, locates matching posts, updates claim metadata, and sends admin notifications. The script is…Continue reading
// Description: // This script manages vendor profile claims within WordPress upon user activation, integrating Gravity Forms activation hooks and handling the normalization of business names for better matching. It adds functionality to normalize and find matching vendor posts by…Continue reading
// Function to normalize business names if (!function_exists(‘normalize_business_name’)) { function normalize_business_name($name) { $original_name = $name; // Save original name for logging if needed $name = strtolower($name); // Convert the string to lowercase to ensure uniformity $name = remove_accents($name); // Remove…Continue reading
// Function to normalize business names if (!function_exists(‘normalize_business_name’)) { function normalize_business_name($name) { $original_name = $name; // Save original name for logging if needed $name = strtolower($name); // Convert the string to lowercase to ensure uniformity $name = remove_accents($name); // Remove…Continue reading
// Create ‘Vendor Claims’ admin page and subpages for approved and denied claims function vendor_claim_admin_menu() { add_menu_page( ‘Vendor Claims’, // Page title ‘Vendor Claims’, // Menu title ‘manage_options’, // Capability (Admin access only) ‘vendor-claims’, // Menu slug (used in the…Continue reading