• Resolved Alexander Guskov

    (@forcesail)


    Hello,

    It seems that the plugin loses wp_enqueue_script (at least with in_footer=false) and wp_enqueue_style that called somewhere in the_content (say, from shortcode).

    It works perfectly in WordPress since, at list v.3.6, but not if WPO minifys.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support vupdraft

    (@vupdraft)

    Hi,

    Can you give us step by step instructions on how to recreate your issue along with expected results and actual results?

    Thread Starter Alexander Guskov

    (@forcesail)

    Hello. Indeed:

    1. Create plugin with next code:
      add_shortcode( ‘testwpo’, function( $attr, $content ) {wp_enqueue_style( ‘testwpo’, plugins_url(‘/testwpo.css’, __FILE__), array(), ‘1.0’, ‘all’ ); });

    2. Create file testwpo.css:
    #testwpo { color: red; font-size: 40px; }

    3. Create page under WP:
    [testwpo]
    <p id=’testwpo’>test WPO</p>

    4. Deactivate WPO and open the page in browser. Enjoy large red text “test WPO”

    5. Activate WPO and enjoy the same large red text until minification css and ” Inline CSS – Recommended if the CSS files are small enough.” is on.

    I tried with v.3.2.22

    I hope that tens of my error reports and hours of understanding of the plugin’s code to localize them and tests helps you to make the plugin working properly.

    P.S. I’m sorry but the devil’s block editor embeded in this page has been making a mess from the code that I wrote for you but I hope you guess the idea.

    Plugin Support Kowsar Hossain

    (@kowsar89)

    Thanks for providing the code reference. I’ve initiated an internal ticket in our system to conduct a more in-depth investigation. We’ll reach out to you if we require any additional information.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Losing wp_enqueue_script / wp_enqueue_style in the middle of a post’ is closed to new replies.