REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.08 KB
Close
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/woocommerce/src/Blocks/Utils/BlocksWpQuery.php
Text
Base64
<?php namespace Automattic\WooCommerce\Blocks\Utils; use WP_Query; /** * BlocksWpQuery query. * * Wrapper for WP Query with additional helper methods. * Allows query args to be set and parsed without doing running it, so that a cache can be used. * * @deprecated 2.5.0 */ class BlocksWpQuery extends WP_Query { /** * Constructor. * * Sets up the WordPress query, if parameter is not empty. * * Unlike the constructor in WP_Query, this does not RUN the query. * * @param string|array $query URL query string or array of vars. */ public function __construct( $query = '' ) { if ( ! empty( $query ) ) { $this->init(); $this->query = wp_parse_args( $query ); $this->query_vars = $this->query; $this->parse_query_vars(); } } /** * Get cached posts, if a cache exists. * * A hash is generated using the array of query_vars. If doing custom queries via filters such as posts_where * (where the SQL query is manipulated directly) you can still ensure there is a unique hash by injecting custom * query vars via the parse_query filter. For example: * * add_filter( 'parse_query', function( $wp_query ) { * $wp_query->query_vars['my_custom_query_var'] = true; * } ); * * Doing so won't have any negative effect on the query itself, and it will cause the hash to change. * * @param string $transient_version Transient version to allow for invalidation. * @return WP_Post[]|int[] Array of post objects or post IDs. */ public function get_cached_posts( $transient_version = '' ) { $hash = md5( wp_json_encode( $this->query_vars ) ); $transient_name = 'wc_blocks_query_' . $hash; $transient_value = get_transient( $transient_name ); if ( isset( $transient_value, $transient_value['version'], $transient_value['value'] ) && $transient_value['version'] === $transient_version ) { return $transient_value['value']; } $results = $this->get_posts(); set_transient( $transient_name, array( 'version' => $transient_version, 'value' => $results, ), DAY_IN_SECONDS * 30 ); return $results; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
BlockHooksTrait.php
6.89 KB
lrw-r--r--
2024-07-30 19:31:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlocksSharedState.php
6.86 KB
lrw-r--r--
2026-03-30 17:12:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlocksWpQuery.php
2.08 KB
lrw-r--r--
2023-12-27 00:45:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlockTemplateUtils.php
30.09 KB
lrw-r--r--
2026-05-05 14:26:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CartCheckoutUtils.php
17.33 KB
lrw-r--r--
2026-05-05 14:26:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MiniCartUtils.php
3.51 KB
lrw-r--r--
2024-11-14 01:17:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductAvailabilityUtils.php
1.26 KB
lrw-r--r--
2025-07-29 12:34:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductDataUtils.php
455 B
lrw-r--r--
2025-06-23 19:46:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProductGalleryUtils.php
5.75 KB
lrw-r--r--
2026-03-30 17:12:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
StyleAttributesUtils.php
23.12 KB
lrw-r--r--
2025-05-12 21:07:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Utils.php
1.21 KB
lrw-r--r--
2023-12-27 00:45:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).