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_ConditionCallbacks::post_type_category( array $condition = array() )
Checks if the post_type has the selected categories.
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
- $condition
-
(Optional)
Default value: array()
Return Return
(bool)
Source Source
File: classes/ConditionCallbacks.php
public static function post_type_category( $condition = array() ) { $target = explode( '_w_', $condition['target'] ); // First key is the post type. $post_type = array_shift( $target ); $selected = ! empty( $condition['settings']['selected'] ) ? $condition['settings']['selected'] : array(); if ( self::is_post_type( $post_type ) && has_category( wp_parse_id_list( $selected ) ) ) { return true; } return false; }
Expand full source code Collapse full source code View on Trac