[wp-trac] [WordPress Trac] #57095: Shortcode's query are executing at backend because of the_content filter

WordPress Trac noreply at wordpress.org
Mon Nov 14 16:45:53 UTC 2022


#57095: Shortcode's query are executing at backend because of the_content filter
--------------------------+------------------------------
 Reporter:  vijayhardaha  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by vijayhardaha):

 Thanks for the reply @TimothyBlynJacobs

 For example, if we use `[products limit=4]` shortcode in the classic
 editor so this shortcode is a simple text that should be transformed into
 something on the front end. so putting the shortcode tag in the classic
 editor doesn't execute the code inside the shortcode.

 the same behavior should be applied with the block editor as well, if I am
 putting a shortcode in page/post content, the shortcode code should be
 executed in the front only not in the backend.

 In my original issue and GitHub issue, you'll see that
 `WC_Shortcodes:products()` and other functions are being called, but in
 general when we add a shortcode in the backend, we don't render any
 preview, so it should not execute the queries and functions which is in a
 shortcode callback function.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57095#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list