/** * s2Member's Security Gate (protects WordPress queries). * * @package s2Member\Security * @since 3.5 * * @attaches-to ``add_action('pre_get_posts');`` * * @param WP_Query $wp_query Global ``$wp_query``, by reference. * * @return null May filter WordPress queries, by hiding protected content which is NOT available to the current User/Member. */ public static function security_gate_query(&$wp_query = NULL) { do_action('ws_plugin__s2member_before_security_gate_query', get_defined_vars()); c_ws_plugin__s2member_querys::query_level_access($wp_query); // By reference. do_action('ws_plugin__s2member_after_security_gate_query', get_defined_vars()); }
/** * s2Member's Security Gate ( protects WordPress® queries ). * * @package s2Member\Security * @since 3.5 * * @attaches-to ``add_action("pre_get_posts");`` * * @param obj $wp_query Global ``$wp_query``, by reference. * @return null May filter WordPress® queries, by hiding protected content which is NOT available to the current User/Member. */ public static function security_gate_query(&$wp_query = FALSE) { do_action("ws_plugin__s2member_before_security_gate_query", get_defined_vars()); /**/ c_ws_plugin__s2member_querys::query_level_access($wp_query); /* By reference. */ /**/ do_action("ws_plugin__s2member_after_security_gate_query", get_defined_vars()); /**/ return; /* Return for uniformity. */ }
/** * Always filters Systematics in search results & feeds. * * s2Member respects the query var: `suppress_filters`. * If you need to make a query without it being Filtered, use ``$wp_query->set ("suppress_filters", true);``. * * @package s2Member\Queries * @since 3.5 * * @param obj $wp_query Expects ``$wp_query`` by reference. * @return null */ public static function _query_level_access_sys(&$wp_query = FALSE) { global $wpdb; /* Need this global DB object reference here. */ /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("_ws_plugin__s2member_before_query_level_access_sys", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ if (is_object($wpdb) && is_object($wp_query) && !($suppressing_filters = $wp_query->get("suppress_filters"))) { if (!is_admin() && ($wp_query->is_search() || $wp_query->is_feed()) || c_ws_plugin__s2member_querys::_is_admin_ajax_search($wp_query)) { $s = $systematics = array($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"], $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]); $s = $systematics = c_ws_plugin__s2member_utils_arrays::force_integers($s); /**/ $wp_query->set("post__not_in", array_unique(array_merge(c_ws_plugin__s2member_utils_arrays::force_integers((array) $wp_query->get("post__not_in")), $s))); $wp_query->set("post__in", array_unique(array_diff(c_ws_plugin__s2member_utils_arrays::force_integers((array) $wp_query->get("post__in")), $s))); /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("_ws_plugin__s2member_during_query_level_access_sys", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ } } /**/ eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;'); do_action("_ws_plugin__s2member_after_query_level_access_sys", get_defined_vars()); unset($__refs, $__v); /* Unset defined __refs, __v. */ /**/ return; /* For uniformity. */ }
/** * Always filters Systematics in search results & feeds. * * s2Member respects the query var: `suppress_filters`. * If you need to make a query without it being Filtered, use ``$wp_query->set ('suppress_filters', true);``. * * @package s2Member\Queries * @since 3.5 * * @param object $wp_query Expects ``$wp_query`` by reference. */ public static function _query_level_access_sys(&$wp_query = NULL) { global $wpdb; // Global DB object reference. foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('_ws_plugin__s2member_before_query_level_access_sys', get_defined_vars()); unset($__refs, $__v); // Housekeeping. if (is_object($wpdb) && is_object($wp_query) && !($suppressing_filters = $wp_query->get('suppress_filters'))) { if (!is_admin() && ($wp_query->is_search() || $wp_query->is_feed()) || c_ws_plugin__s2member_querys::_is_admin_ajax_search($wp_query)) { $s = $systematics = array($GLOBALS['WS_PLUGIN__']['s2member']['o']['login_welcome_page'], $GLOBALS['WS_PLUGIN__']['s2member']['o']['membership_options_page'], $GLOBALS['WS_PLUGIN__']['s2member']['o']['file_download_limit_exceeded_page']); $s = $systematics = c_ws_plugin__s2member_utils_arrays::force_integers($s); // Force integer values here. $wp_query->set('post__not_in', array_unique(array_merge(c_ws_plugin__s2member_utils_arrays::force_integers((array) $wp_query->get('post__not_in')), $s))); $wp_query->set('post__in', array_unique(array_diff(c_ws_plugin__s2member_utils_arrays::force_integers((array) $wp_query->get('post__in')), $s))); foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('_ws_plugin__s2member_during_query_level_access_sys', get_defined_vars()); unset($__refs, $__v); // Housekeeping. } } foreach (array_keys(get_defined_vars()) as $__v) { $__refs[$__v] =& ${$__v}; } do_action('_ws_plugin__s2member_after_query_level_access_sys', get_defined_vars()); unset($__refs, $__v); // Housekeeping. }