Giter VIP home page Giter VIP logo

Comments (4)

bobbingwide avatar bobbingwide commented on June 17, 2024

One query that doesn't get filtered is for the shortcode in the Sequentially Biased section of the sidebar.
The shortcode is [bw_list post_type=bigram posts_per_page=16 orderby=date order=DESC exclude=0]
The query that's run is:

[54] => Array

            [0] => (string) "SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'bigram' AND ((wp_posts.post_status = 'publish'))  ORDER BY wp_posts.post_date DESC LIMIT 0, 16"
            [1] => (double) 0.013906002044678
            [2] => (string) "require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('wp-includes/template-canvas.php'), get_the_block_template_html, do_blocks, render_block, WP_Block->render, sb_render_block_core_template_part, do_blocks, render_block, WP_Block->render, WP_Block->render, WP_Block->render, sb_render_block_core_template_part, do_blocks, render_block, WP_Block->render, sb_render_block_core_template_part, do_shortcode, preg_replace_callback, do_shortcode_tag, bw_shortcode_event, bw_list, bw_get_posts, _bw_get_posts, WP_Query->query, WP_Query->get_posts"
            [3] => (double) 1652252152.1072
            [4] => Array

This uses _bw_get_posts() which sets the suppress_filters query parameter to true.
When this is set, WP_Query::get_posts() doesn't invoke filter functions, including the_posts.

from sb.

bobbingwide avatar bobbingwide commented on June 17, 2024

For the queries which are accessing wp_template or wp_template_part we can skip the filtering when the post_type is scalar and not bigram

from sb.

bobbingwide avatar bobbingwide commented on June 17, 2024

Regarding the unnecessary query performed by the query-no-results block.
The simplest solution would be to remove it from the template part.

  • When there are no results on the home page then you just get a couple of separators.
  • But that's fine.
  • The search page looks the same.
  • See s.b/wp55/sb

from sb.

bobbingwide avatar bobbingwide commented on June 17, 2024

Delivered in SB v0.2.1

from sb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.