PHP: Modify CPT Arguments (After Initial Registration)

// WP Docs: https://developer.wordpress.org/reference/functions/register_post_type/#parameters // Reference: https://zerowp.com/modify-cpt-arguments-after-it-was-registered/ // Example below: add_action(‘register_post_type_args’, function ($args, $postType) { if ($postType !== ‘book’){ return $args; } $args[‘show_in_rest’] = true; $args[‘public’] = true; return $args; }, 99, 2);Continue reading

PHP: Modify CPT Arguments (After Initial Registration)

// WP Docs: https://developer.wordpress.org/reference/functions/register_post_type/#parameters // Reference: https://zerowp.com/modify-cpt-arguments-after-it-was-registered/ // Example below: add_action(‘register_post_type_args’, function ($args, $postType) { if ($postType !== ‘book’){ return $args; } $args[‘show_in_rest’] = true; $args[‘public’] = true; return $args; }, 99, 2);Continue reading

GridBuilder Vendor Category Query

// function grid_query_related_posts( $query_args, $grid_id ) { // global $post; // if ( 155 !== $grid_id ) { // return $query_args; // } // $taxonomy = ‘vendor-category’; // $post_id = wp_doing_ajax() ? url_to_postid( wp_get_referer() ) : $post->ID; // $terms =…Continue reading

Remove Gateway Choice On A Campaign/Donation Page

// add this snippet to functions.php in your theme add_filter( ‘charitable_active_gateways’, ‘charitable_change_gateways_per_campaign’, 10, 1 ); function charitable_change_gateways_per_campaign( $gateways ) { global $post; // $gateways will be an array similar to this: // [offline] => Charitable_Gateway_Offline // [stripe] => Charitable_Gateway_Stripe_AM if…Continue reading

Event Data | Display Eventbrite Events

add_filter( ‘wfea_api_results’, // hook to filter returned event data before display /** * @param $events * @param $atts * * @return mixed * @throws Exception */ function ( $events, $atts ) { if ( ! in_array( $atts[‘layout’], array( ‘cal_list’, ‘cal’…Continue reading