| @@ -159,10 +159,12 @@ | ||
| 159 | 159 | break; |
| 160 | 160 | }//end switch |
| 161 | 161 | |
| 162 | 162 | $meta_where = implode( ' OR ', $meta_conditions ); |
| 163 | + // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared | |
| 163 | 164 | $query = $wpdb->prepare( $query, $location, $post_type ) . " AND ({$meta_where}) ORDER BY p.post_date DESC"; |
| 164 | 165 | |
| 166 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 165 | 167 | $posts = $wpdb->get_results( $query ); |
| 166 | 168 | |
| 167 | 169 | foreach ( $posts as $local_post ) { |
| 168 | 170 | self::$current_page_data[ $post_type ][ $local_post->ID ] = [ |
| @@ -469,6 +471,21 @@ | ||
| 469 | 471 | }//end foreach |
| 470 | 472 | }//end if |
| 471 | 473 | |
| 472 | 474 | return $show_popup; |
| 475 | + } | |
| 476 | + | |
| 477 | + public static function get_info_popup_builder_content() { | |
| 478 | + global $wpdb; | |
| 479 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 480 | + return $wpdb->get_results(" | |
| 481 | + SELECT p.ID, p.post_content | |
| 482 | + FROM {$wpdb->prefix}posts AS p | |
| 483 | + INNER JOIN {$wpdb->prefix}postmeta AS pm | |
| 484 | + ON p.ID = pm.post_id | |
| 485 | + WHERE p.post_type = 'ablocks_tb' | |
| 486 | + AND p.post_status = 'publish' | |
| 487 | + AND pm.meta_key = 'ablocks_tb_template_type' | |
| 488 | + AND pm.meta_value = 'info-popup-builder' | |
| 489 | + "); | |
| 473 | 490 | } |
| 474 | 491 | } |