Support

Account

Home Forums Backend Issues (wp-admin) ACF fields in WooCommerce Membership Plans

Solved

ACF fields in WooCommerce Membership Plans

  • Is it possible to have ACF fields in the WooCommerce Membership Plans? (Screenshot attached)

    I have looked and thought it might be under post type but not getting the fields to appear.

    Thanks

  • forbiddenChunk’s link works great for members, but not teams. I tried modifying it to allow adding acf to teams:

    
    $field_groups = array_merge(
    			acf_get_field_groups( array( 'post_type' => 'wc_membership_plan' ) ),
    			acf_get_field_groups( array( 'post_type' => 'wc_user_membership' ) ),
    			acf_get_field_groups( array( 'post_type' => 'wc_memberships_team' ) )
    		);

    .. but this didnt work. any ideas how to allow ACF fields in wp-admin pages for woo teams?

  • It needs to be a different filter. so i coded(copy pasted) this:

    function wb_wc_memberships_for_teams_allowed_meta_box_ids( $allowed_meta_box_ids ) {
    	if ( function_exists( 'acf_get_field_groups' ) ) {
    
    		$field_groups = array_merge(			
    			acf_get_field_groups( array( 'post_type' => 'wc_memberships_team' ) )
    		);
    
    		foreach ( $field_groups as $field_group ) {
    			$allowed_meta_box_ids[] = 'acf-' . $field_group['key'];
    		}
    	}
    	return $allowed_meta_box_ids;
    }
    
    add_filter( 'wc_memberships_for_teams_allowed_meta_box_ids', 'wb_wc_memberships_for_teams_allowed_meta_box_ids' );
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.