• Resolved barellano

    (@barellano)


    I have a plugin that requires wp_enqueue_editor() to enqueue editor scripts & stylesheets on the frontend, however, the issue is that the Vantage menu bar does not expand 100% width when using wp_enqueue_editor().

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi, thanks for posting your question.

    What’s the name of the plugin?

    Thread Starter barellano

    (@barellano)

    Hi Andrew, its a premium plugin called WP Courseware. I’d be glad to provide a copy. How can I get it to you?

    Thanks. I’ve seen this issue once before. When WP Courseware is activated, the Vantage sticky-menu class is being assigned to the body tag at the top of the page, even when the menu is not sticky. Normally the sticky-menu class is assigned to the body tag only once the menu reaches to the top of the window. I don’t know why that’s happening. If you’re able you could perhaps investigate a bit further.

    Thread Starter barellano

    (@barellano)

    Hi Andrew, wp_enqueue_editor() is a native WordPress function which is what is causing the issue. When the function is commented out, the issue resolves. Any other help you can provide?

    Hi, thanks, it’s unlikely that’s directly the issue. What is being loaded? A script? If so, you could try opening the file that is being loaded, clear the contents, save and re-check the issue.

    Thread Starter barellano

    (@barellano)

    Hey Andrew, actually it appears to be directly related. If I disable WP Courseware and modify the functions.php file with the following, I can reproduce the issue.

    add_action( 'wp_enqueue_scripts', 'test_wp_enqueue' );
    function test_wp_enqueue(){
    wp_enqueue_editor();
    }

    Thanks for the test function. Do you see the sticky-menu class added to the body class before scroll when the conflicting plugin is activated?

    I’ll log this shortly for our developer to check up on. Is WP Courseware loading wp_enqueue_editor in the front-end as you have in your test? wp_enqueue_editor is usually used to load admin assets.

    Thread Starter barellano

    (@barellano)

    Yes the sticky-menu class is added to body class with plugin activated. However, if I comment out the line of code with wp_enqueue() in the plugin, the issue is resolved and the sticky-menu class is removed. The test function is the same scenario, it adds the sticky-menu class to body class. I’m 100% certain the issue is a conflict with this WordPress native function.

    Thread Starter barellano

    (@barellano)

    Thank you Andrew. Yes, WP Courseware seems to be running this on the front end via wp_enqueue_scripts.

    Thanks for confirming the sticky class issue. The sticky-menu class is normally added when the menu reaches the top of the window.

    Why would wp_enqueue_editor be loaded in the front-end (wp_enqueue_scripts)? Is WP Courseware doing the same? Wouldn’t admin_enqueue_scripts be a more logical hook for your test function?

    Sorry, I just read your latest comment. If you have a moment, please could you try opening a ticket with the plugin authors. I’m not quite following why they’ve hooked wp_enqueue_editor into wp_enqueue_scripts.

    On our website contact page you’ll find our email address. If needed, the plugin authors are welcome to send us an email and chat with our developer. That said, you might be able to make progress with what we’ve discovered here today.

    Thread Starter barellano

    (@barellano)

    Hi Andrew, I did reachout via your website contact form. Not sure if you got the message. I spoke with WP Courseware support. The issue that is causing the sticky-menu is indeed when the wp_editor() function is called. The reason this is called on the front end is because WP Courseware units have a feature where students can take notes and the editor is required to enter the notes in the UI. Again, this function is native WordPress functionality.

    Hi BJ

    Thanks for your reply.

    We’re aware that the functions discussed in this thread are part of the WordPress core. We actively use those same functions in our plugins. There is no misunderstanding as to what is and what isn’t a core function. We haven’t typically seen the discussed functions used on the site front-end which is why this hasn’t been raised previously, at least not in detail. I have seen one previous report but it wasn’t full diagnosed.

    Alex has replied to your email, he’s sent you a build that prefixes the Vantage sticky-menu class. WordPress is using that same class name in conjunction with the discussed functions which is where the issue is occurring.

    Thanks
    Andrew

Viewing 15 replies - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.