/* Customize the Action Scheduler Retention Period * * Original doc: https://wpmailsmtp.com/docs/how-to-troubleshoot-action-scheduler-issues-wp-mail-smtp-2-1-1/ */ function custom_as_retention_period() { // Changes default 30-day retention to 7-days return WEEK_IN_SECONDS; } add_filter( ‘action_scheduler_retention_period’, ‘custom_as_retention_period’ );Continue reading
add_filter(‘rank_math/snippet/rich_snippet_product_entity’, function ($entity) { $score = get_post_meta(get_the_ID(), ‘_wc_average_rating’, true); // Replace with your rating post meta. $count = get_post_meta(get_the_ID(), ‘_wc_review_count’, true); // Replace with your rating count post meta. $entity[‘aggregateRating’] = array( ‘@type’ => ‘aggregateRating’, ‘ratingValue’ => $score, ‘ratingCount’ =>…Continue reading
function woocommerce_sale_flash_from_woo_discount_rules_v2($html, $post, $product){ $discounted_price = apply_filters(‘advanced_woo_discount_rules_get_product_discount_price_from_custom_price’, false, $product, 1, 0, ‘discounted_price’, true); if($discounted_price !== false){ $percentage = round( ( ( $product->get_price() – $discounted_price ) / $product->get_price()) * 100 ); $html = ‘ -‘ . $percentage . ‘%’ . ‘…Continue reading
function woocommerce_sale_flash_from_woo_discount_rules_v2($html, $post, $product){ $discounted_price = apply_filters(‘advanced_woo_discount_rules_get_product_discount_price_from_custom_price’, false, $product, 1, 0, ‘discounted_price’, true); if($discounted_price !== false){ $percentage = round( ( ( $product->get_price() – $discounted_price ) / $product->get_price()) * 100 ); $html = ‘ -‘ . $percentage . ‘%’ . ‘…Continue reading
// Customize the time slot format for JetAppointment. // This filter modifies the format of time slots to display only the start time. add_filter( ‘jet-apb/time-slots/slots-html/slot-time-format’, function( $format ) { $format = ‘%4$s’; return $format; } );Continue reading
add_filter(‘gform_notification_enable_cc’, ‘enable_cc’, 10, 3 ); function enable_cc( $enable, $notification, $form ){ return true; }Continue reading
function utdt_logout2() { $user_id = get_current_user_id(); $txt = sprintf($user_id = ” has been Logged out of Under the Dementia Tree.”); echo $txt; wp_destroy_current_session(); wp_clear_auth_cookie(); wp_set_current_user( 0 ); do_action( ‘utdt_logout2’, $user_id ); }Continue reading
// Remove plugin deactivation for all users except ‘rubberduckers’ function rubberduckers_disable_plugin_deactivation($actions, $plugin_file, $plugin_data, $context) { // Get the current user $current_user = wp_get_current_user(); // Check if the current user’s username is NOT ‘rubberduckers’ if ($current_user->user_login !== ‘rubberduckers’) { // List…Continue reading
/* * */ function change_min_donation_text( $text, $amount ) { return ‘ ‘ . __( ‘The minimum donation for this campaign is ‘, ‘charitable’ ) . charitable_format_money( $amount, false, true ) . ‘. ‘; } add_filter( ‘charitable_donationa_amount_notice’, ‘change_min_donation_text’, 10, 2 );Continue reading