• Resolved devtestconcise

    (@devtestconcise)


    I have a quite heavy load Shortcode (which will considerably take a little long time to load) and if I add it to the Posts or Pages, it takes a very long time to move the particular Post or Page to Trash, and even while restore it back. This should not happen since Shortcodes will be rendered only in Front-end and not sure about the purpose of accessing that Shortcode function while moving the Post to Trash (or restoring it). If I remove the particular Shortcode, everything looks normal.

    The same issue appears when I update the Post too.

    Please help me in resolving this issue and thanks for your assistance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What is your shortcode and where do you insert it? In the post content? If necessary, you can simply exclude in your shortcode that it is executed in wp-admin.

    if( is_admin() ) { return ''; }

    right at the beginning of your function.

    Thread Starter devtestconcise

    (@devtestconcise)

    Yes, I added my Shortcode in the Post content.

    Thanks for the solution and it works ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Shortcode issue while moving a Post to Trash or Restore it’ is closed to new replies.