Remove Gutenberg Comment for Vendor Post Content

add_action( ‘save_post_vendor’, ‘clean_gutenberg_comments_on_save’, 10, 3 ); function clean_gutenberg_comments_on_save( $post_id, $post, $update ) { // Only run on updates, not when auto-saving or revisioning if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) { return; } // Ensure we’re dealing with the…Continue reading

MemberPress: Disable Emails for Specific Memberships

function mepr_disable_membership_emails( $recipients, $subject, $message, $headers ) { if( strpos( $message, ‘Free Membership’ ) !== false ) { return null; } return $recipients; } add_filter( ‘mepr-wp-mail-recipients’, ‘mepr_disable_membership_emails’, 10, 4 );Continue reading

MemberPress: Send Email to User When Their User Role Is Changed

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/Venue Post

// 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

PHP [Gravity Wiz]: Update Vendor Post

/** // * 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

Fix Image Caption Rendering Issue Caused by WPResidence Theme

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