You appear to be a bot. Output may be restricted
Description
Insert any post terms
Usage
bw_set_post_terms( $post_type, $validated, $post_ID );
Parameters
- $post_type
- ( string ) required –
- $validated
- ( array ) required – array of validated fields
- $post_ID
- ( mixed ) required –
Returns
voidSource
File name: oik-fields/shortcodes/oik-new.phpLines:
1 to 13 of 13
function bw_set_post_terms( $post_type, $validated, $post_ID ) { //bw_trace2( ); $fields = bw_get_field_names( $post_ID ); foreach ( $fields as $field_name ) { $field_type = bw_query_field_type( $field_name ); if ( $field_type === "taxonomy" ) { $term_value = bw_array_get( $validated, $field_name, null ); if ( $term_value ) { wp_set_post_terms( $post_ID, $term_value, $field_name ); } } } }View on GitHub