0 ) { $post_terms = wp_get_object_terms( $post_id, $taxonomy ); if ( is_wp_error( $post_terms ) ) { continue; } $term_ids = array_merge( $term_ids, wp_list_pluck( $post_terms, 'term_id' ) ); } else { $is_category = 'category' === $taxonomy && is_category(); $is_tag = ! $is_category && 'post_tag' === $taxonomy && is_tag(); $is_tax = ! $is_category && ! $is_tag && is_tax( $taxonomy ); if ( $is_category || $is_tag || $is_tax ) { $term_ids[] = get_queried_object()->term_id; } } continue; } $term_ids[] = (int) $value; } $term_ids = self::filter_invalid_term_ids( array_unique( array_filter( $term_ids ) ), $taxonomy ); return $term_ids; } /** * Handle common filtering of included categories, including handling meta categories. * * @since 4.0 * * @param string|array $include_categories Comma-separated list of term ids and special keywords. * @param integer $post_id * @param string $taxonomy * * @return array */ protected static function filter_include_categories( $include_categories, $post_id = 0, $taxonomy = 'category' ) { $categories = array(); if ( ! empty( $include_categories ) ) { // wp_doing_ajax() covers VB usage when fetching computed values where we always have a post. if ( is_singular() || wp_doing_ajax() ) { $post_id = $post_id > 0 ? $post_id : self::get_current_post_id_reverse(); $categories = self::filter_meta_categories( $include_categories, $post_id, $taxonomy ); } else { $categories = self::filter_meta_categories( $include_categories, 0, $taxonomy ); } } return $categories; } public static function is_processing_computed_prop() { global $et_fb_processing_shortcode_object; return $et_fb_processing_shortcode_object || ( wp_doing_ajax() && 'et_pb_process_computed_property' === $_POST['action'] ); } }