cf_custom_fields_get_taxonomy_fields
Find taxonomy fields and values.
Description
(array) cf_custom_fields_get_taxonomy_fields( $all_fields );
Returns (array)
Parameters (1)
- 0. $all_fields
- The all fields.
Usage
if ( !function_exists( 'cf_custom_fields_get_taxonomy_fields' ) ) { require_once ABSPATH . PLUGINDIR . 'caldera-custom-fields/includes/to-post-type.php'; } // The all fields. $all_fields = null; // NOTICE! Understand what this does before running. $result = cf_custom_fields_get_taxonomy_fields($all_fields);
Defined (2)
The function is defined in the following location(s).
- /includes/to-post-type.php
- function cf_custom_fields_get_taxonomy_fields( $all_fields ) {
- $tax_fields = array();
- foreach( $all_fields as $field => $value ) {
- if( false !== strpos( $field, 'cf-custom-fields-tax-') ) {
- if ( ! empty( $value ) ) {
- $tax_fields[ $field ] = array(
- 'taxonomy' => str_replace( 'cf-custom-fields-tax-', '', $field ),
- 'terms' => Caldera_Forms::do_magic_tags( $value )
- );
- }
- }
- }
- return $tax_fields;
- }
- function cf_custom_fields_get_taxonomy_fields( $all_fields ) {
- $tax_fields = array();
- foreach( $all_fields as $field => $value ) {
- if( false !== strpos( $field, 'cf-custom-fields-tax-') ) {
- if ( ! empty( $value ) ) {
- $tax_fields[ $field ] = array(
- 'taxonomy' => str_replace( 'cf-custom-fields-tax-', '', $field ),
- 'terms' => Caldera_Forms::do_magic_tags( $value )
- );
- }
- }
- }
- return $tax_fields;
- }