if ( !$config->get_boolean( 'pgcache.reject.logged' ) ) $post_status[] = 'private'; break; case 'dbcache': if ( !$config->get_boolean( 'dbcache.reject.logged' ) ) $post_status[] = 'private'; break; } $flushable = is_object( $post ) && !in_array( $post->post_type, $post_type ) && in_array( $post->post_status, $post_status ); return apply_filters( 'w3tc_flushable_post', $flushable, $post, $module ); } /** * Converts value to boolean * * @param mixed $value * @return boolean */ static public function to_boolean( $value ) { if ( is_string( $value ) ) { switch ( strtolower( $value ) ) { case '+': case '1': case 'y': case 'on': case 'yes': case 'true': case 'enabled': return true; case '-': case '0': case 'n': case 'no': case 'off': case 'false': case 'disabled': return false; } } return (boolean) $value; } /** * Returns the apache, nginx version * * @return string */ static public function get_server_version() { $sig= explode( '/', $_SERVER['SERVER_SOFTWARE'] ); $temp = isset( $sig[1] ) ? explode( ' ', $sig[1] ) : array( '0' ); $version = $temp[0]; return $version; } /** * Checks if current request is REST REQUEST */ static public function is_rest_request( $url ) { if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) return true; // in case when called before constant is set // wp filters are not available in that case return preg_match( '~' . W3TC_WP_JSON_URI . '~', $url ); } static public function reset_microcache() { global $w3_current_blog_id; $w3_current_blog_id = null; self::$is_using_master_config = null; } }