Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Conditions::generate_post_type_tax_conditions( $name )
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $name
-
(Required)
Return Return
(array)
Source Source
File: classes/Conditions.php
public function generate_post_type_tax_conditions( $name ) { $post_type = get_post_type_object( $name ); $taxonomies = get_object_taxonomies( $name, 'object' ); $conditions = array(); foreach ( $taxonomies as $tax_name => $taxonomy ) { $conditions[ $name . '_w_' . $tax_name ] = array( 'group' => $post_type->labels->name, 'name' => sprintf( _x( '%1$s: With %2$s', 'condition: post type plural and taxonomy singular label ie. Posts: With Category', 'popup-maker' ), $post_type->labels->name, $taxonomy->labels->singular_name ), 'fields' => array( 'selected' => array( 'placeholder' => sprintf( _x( 'Select %s.', 'condition: post type plural label ie. Select categories', 'popup-maker' ), strtolower( $taxonomy->labels->name ) ), 'type' => 'taxonomyselect', 'taxonomy' => $tax_name, 'multiple' => true, 'as_array' => true, ), ), 'callback' => array( 'PUM_ConditionCallbacks', 'post_type_tax' ), ); } return $conditions; }
Expand full source code Collapse full source code View on Trac