/** * Validates the rule on negative assertion. * * @access public * @return boolean TRUE if assertion is successfull, otherwise FALSE. */ public function validate_negative($args = null) { $page = get_queried_object(); $page_ids = $this->get_dripped_page_ids($this->data); if (is_array($args) && $args[0]['cascade'] && isset($page->ID)) { if ($this->validate_parent($page->ID, $page_ids)) { return true; } } return is_a($page, 'WP_Post') && $page->post_type == 'page' ? !in_array($page->ID, $page_ids) : parent::validate_negative(); }
/** * Validates the rule on negative assertion. * * @access public * @return boolean TRUE if assertion is successfull, otherwise FALSE. */ public function validate_negative($args = null) { $this->cat_ids = $this->get_dripped_category_ids($this->data); // if( $this->is_post_valid( $args ) ) { // return true; // }; if (is_single() && in_array('category', get_object_taxonomies(get_post_type()))) { $categories = wp_get_post_categories(get_the_ID()); $intersect = array_intersect($categories, $this->cat_ids); return empty($intersect); } if (is_category()) { return !in_array(get_queried_object_id(), $this->cat_ids); } return parent::validate_negative(); }
public function validate_negative($args = null) { $component = bp_current_component(); if ($component) { $pages = bp_core_get_directory_page_ids(); if (!empty($pages[$component])) { return !in_array($pages[$component], $this->data); } } return parent::validate_negative(); }
public function validate_negative($args = null) { global $bp; if (bp_current_component() != 'groups') { return parent::validate_negative(); } return isset($bp->groups->current_group) && is_a($bp->groups->current_group, 'BP_Groups_Group') ? !in_array($bp->groups->current_group, $this->data) : parent::validate_negative(); }
public function validate_negative($args = null) { if ($this->is_category_invalid($args)) { return false; } $page = get_queried_object(); $this->post_ids = $this->get_dripped_post_ids($this->data); return is_a($page, 'WP_Post') && $page->post_type == 'post' ? !in_array($page->ID, $this->post_ids) : parent::validate_negative(); }