Forminator Post Data – Only specific article categories allowed
-
Hello guys!
How can I create a filter to allow only some specific post article categories to be used in Forminator (Create Post – Post Data). Thank you for this awesome plugin! ??Now, I tried to use something like this but this didn’t work:
add_filter( 'forminator_field_postdata_post_category_list', function( $categories ) { $allowed_cat = array( 54, 46 ); foreach( $categories as $key => $cat ) { if( ! in_array( $cat->term_id, $allowed_cat ) ) { unset( $categories[$key] ); } } return $categories; } );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Forminator Post Data – Only specific article categories allowed’ is closed to new replies.