/** * Check the existence of a kind of View (normal or archive) * * @param $query_mode kind of View object: normal or archive * @return array() of relevant Views if they exists or false if not */ function wpv_check_views_exists($query_mode) { $all_views_ids = _wpv_get_all_view_ids($query_mode); if (count($all_views_ids) != 0) { return $all_views_ids; } else { return false; } }
/** * wpv_check_views_exists * * Checks the existence of Views given a query mode. * * @param (string|array) $query_mode Kind of View object: 'normal' or 'archive' (or 'layouts-loop'). * @param $args = array( * @param $args['status'] (array|false) the View status to be counted, if needed * @param $args['orderby'] (string|false) the sorting order, if needed * * @return (array|false) array of View IDs or false * * @since unknown */ function wpv_check_views_exists($query_mode, $args = array()) { $defaults = array('post_status' => false, 'orderby' => false); $args = wp_parse_args($args, $defaults); $all_views_ids = _wpv_get_all_view_ids($query_mode, $args); if (count($all_views_ids) != 0) { return $all_views_ids; } else { return false; } }