function mepr_subaccount_email_parameter( $params, $txn ) { global $wpdb; $user = $txn->user(); $caid = get_user_meta( $user->ID, ‘mpca_corporate_account_id’, true ); if(empty( $caid ) ) { $query = $wpdb->prepare( “SELECT uuid FROM {$wpdb->prefix}mepr_corporate_accounts WHERE user_id = %d”, (int)$user->ID ); $uuid = $wpdb->get_var( $query…Continue reading
add_filter( ‘aioseo_facebook_tags’, ‘aioseo_filter_remove_facebook_tags’ ); function aioseo_filter_remove_facebook_tags( $facebookMeta ) { $uri = parse_url( $_SERVER[‘REQUEST_URI’], PHP_URL_PATH ); if ( strpos( $uri, ‘/listing-detail/’ ) !== false ) { return array(); } return $facebookMeta; }Continue reading
add_filter( ‘the_content’, function ( $content ) { // Return early if it is a single post. if ( is_singular( ‘post’ ) ) { return $content; } return str_replace( ‘Continue reading
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
function mepr_custom_failed_status_email( $txn ) { \MeprUtils::send_failed_txn_notices( $txn ); } add_action( ‘mepr-txn-status-failed’, ‘mepr_custom_failed_status_email’ );Continue reading
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
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
add_filter( ‘tasty_pins_old_attributes_migration_content’, function ( $content, $post ) { if ( str_contains( $content, ‘WP Tasty’ ) ){ update_post_meta( $post->ID, ‘wp-tasty-here’, true ); } // You can also change $content to modify the contents of the post. return $content; }, 10, 2…Continue reading
// Include Simple HTML DOM parsing library if needed (you can also manually include it if necessary) if (!function_exists(‘file_get_html’)) { function file_get_html($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $output = curl_exec($ch); curl_close($ch); return…Continue reading
// Include Simple HTML DOM parsing library if needed (you can also manually include it if necessary) if (!function_exists(‘file_get_html’)) { function file_get_html($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $output = curl_exec($ch); curl_close($ch); return…Continue reading