GF State Abbreviation

add_filter( ‘gform_us_states’, ‘us_states’ ); function us_states( $states ) { $new_states = array(); foreach ( $states as $state ) { $new_states[ GF_Fields::get( ‘address’ )->get_us_state_code( $state ) ] = $state; } return $new_states; }Continue reading

WPForms – Create User Smart Tags from the WordPress profile.

/** * Create User Smart Tags from the WordPress profile. * * @link https://wpforms.com/developers/how-to-create-more-user-smart-tags/ */ function wpf_dev_register_user_profile_smart_tags ( $tags ) { // Key is the tag, item is the tag name. $tags[ ‘wp_nickname’ ] = ‘WP Profile Nickname’; $tags[ ‘wp_username’…Continue reading

Move Jump to Recipe above featured image in Genesis (copy)

/** * Ensures the “Jump to Recipe” button is added above the featured image. */ add_action( ‘init’, function(){ if ( method_exists( ‘Tasty_RecipesShortcodes’, ‘filter_the_content_late’ ) ) { remove_filter( ‘the_content’, array( ‘Tasty_RecipesShortcodes’, ‘filter_the_content_late’ ), 100 ); add_action( ‘genesis_before_entry_content’, function() { echo Tasty_RecipesShortcodes::filter_the_content_late(…Continue reading

MemberPress: Bulk Delete All Expired Subscriptions

function mepr_delete_expired_txns() { $subscriptions = MeprSubscription::get_all(); if( is_array( $subscriptions ) && !empty( $subscriptions ) ) { foreach( $subscriptions as $subscription ) { $subscription = new MeprSubscription( $subscription->id ); if( $subscription->is_cancelled() && $subscription->is_expired() ) { $subscription->destroy(); } } } } add_action(…Continue reading