Automatically Set Featured Image from First Image in Post

function auto_set_featured_image() { global $post; if (!has_post_thumbnail() && $post->post_type == ‘post’) { $attached_image = get_children(“post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1”); if ($attached_image) { foreach ($attached_image as $attachment_id => $attachment) { set_post_thumbnail($post->ID, $attachment_id); break; } } } } add_action(‘save_post’, ‘auto_set_featured_image’);Continue reading

Home Page

Welcome to Eckankar NJ Welcome to Eckankar in New Jersey Join free events and explore spiritual freedom.Continue reading

Untitled Snippet

function wpb_copyright() { global $wpdb; $copyright_dates = $wpdb->get_results(” SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = ‘publish’ “); $output = ”; if($copyright_dates) { $copyright = “© ” . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= ‘-‘…Continue reading

FC – [WOO] – Deshabilitar todos los emails de notificaciones

//* Deshabilitamos todos los emails que manda WooCommerce add_action( ‘woocommerce_email’, function ( $email_class ) { /** * Hooks for sending emails during store events **/ remove_action( ‘woocommerce_low_stock_notification’, array( $email_class, ‘low_stock’ ) ); remove_action( ‘woocommerce_no_stock_notification’, array( $email_class, ‘no_stock’ ) ); remove_action(…Continue reading

MemberPress: Shortcode To Display Manage Sub-Accounts Link

add_shortcode( ‘mepr-subaccount-link’, function() { global $wpdb; $user = MeprUtils::get_currentuserinfo(); if ( ! $user ) { return; } $subaccount_link = ”; $caid = get_user_meta( $user->ID, ‘mpca_corporate_account_id’, true ); if ( empty( $caid ) ) { $query = $wpdb->prepare( “SELECT uuid FROM…Continue reading

MemberPress: Unenrolled Course Shortcode

add_shortcode(‘mpcs-unenrolled-courses’, function() { $unenrolled_courses = array(); $current_user = MeprUtils::get_currentuserinfo(); $mepr_user = new MeprUser( $current_user->ID ); $courses = get_posts( array( ‘post_type’ => ‘mpcs-course’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘-1’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ )); if (false == MeprUtils::is_logged_in_and_an_admin()) {…Continue reading

Hide WPFusion Branding

function white_label_wp_fusion( $translation, $text, $domain ) { if ( ‘wp-fusion’ === $domain ) { $translation = str_replace( ‘WP Fusion’, ‘CRM’, $translation ); } return $translation; } add_filter( ‘gettext’, ‘white_label_wp_fusion’, 10, 3 ); function wpf_whitelabel_crm( &$crm ) { $crm->name = ‘CRM’;…Continue reading

Woo SITE WIDE – Restaurant Hours + backend

/* Plugin Name: Restaurant Hours, Shop Control & Checkout Disable (Enhanced with Vacations, Custom Notices, Dynamic Data, Close Button, Time Until Open, Admin Timezone & Shipping/Payment Disable) Description: Gestiona los horarios del restaurante (con múltiples sesiones en español) y deshabilita…Continue reading