Skip to content

Commit

Permalink
fixes wielebenwir#1725: speed up warmupCache(): search shortcodes onl…
Browse files Browse the repository at this point in the history
…y on published post_type=page|s

Before this fix all kinds of (irrelevant) post_type|s were searched (revision, cb_booking, ...)
  • Loading branch information
nelarsen committed Jan 11, 2025
1 parent 06fa30a commit 3bfcd02
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Service/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,13 @@ public static function warmupCache() {

// First get all pages with cb shortcodes
$sql = "SELECT post_content FROM $table_posts WHERE
post_content LIKE '%cb_items%' OR
(post_content LIKE '%cb_items%' OR
post_content LIKE '%cb_locations%' OR
post_content LIKE '%cb_map%' OR
post_content LIKE '%cb_map%' OR
post_content LIKE '%cb_items_table%' OR
post_content LIKE '%cb_bookings%'";
post_content LIKE '%cb_bookings%') AND
post_type LIKE 'page' AND
post_status LIKE 'publish'";
$pages = $wpdb->get_results( $sql );

// Now extract shortcode calles incl. attributes
Expand Down

0 comments on commit 3bfcd02

Please sign in to comment.