1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Divi editing an accessibility popup

Discussion in 'Free Divi Community Forum' started by CarlosCusi, Mar 25, 2024.

  1. CarlosCusi

    CarlosCusi New Member

    Hi all,

    We have developed a plugin that loads a popup when activated with some accessibility tools.

    It doesn't has to appear on the admin area, so we used is_admin() function to avoid being loaded. It works well everywhere but with DIVI. DIVI tries to edit the popup instead the post.

    Is there a way to avoid this behaviour?. Is there any way to detect DIVI is editing a post?

    Thanks.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Modern & powerful Agency Divi layout pack, featuring team carousel, sliding menu, etc.View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    Try the below in the PHP code & see if it works:
    Code:
    Log In or Sign Up to view this code.
     
  3. CarlosCusi

    CarlosCusi New Member

    Thanks Divi.Help for your quick reply.

    I've digged a litle bit and, would it be the same as this:

    if (empty($_GET['et_fb'])) {
    wp_enqueue_script('my-script', site_url('/test.js'));
    }

    If so, which version would you prefer?
     
    1. PRO MEMBER PERKS Divi Ultimate Header Plugin - Add more varieties for your Divi header (12 premade styles) + menu hover effects:Learn More
  4. Divi.Help

    Divi.Help Administrator
    Staff Member

    You may try both & see which works fine in both frontend & backend builder. I'm not sure if your code will work in backend builder.
     
  5. CarlosCusi

    CarlosCusi New Member

    What if our plugin is installed but DIVI is not.

    I assume this function wont be available, isn't it? So I would need to check if it exists.
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade horizontal timeline design for your Divi site without using any plugins:View Demo
  6. Divi.Help

    Divi.Help Administrator
    Staff Member

    Perhaps you may add another condition as per below below:
    Code:
    Log In or Sign Up to view this code.
     
  7. CarlosCusi

    CarlosCusi New Member

    Hi there,
    Didn't worked. :(

    This code is in the main plugin class:

    PHP:
    if ( is_admin() || ( function_exists('is_et_pb_preview') && is_et_pb_preview() ) )
    {
        
    // Load only admin part
        
    require_once PLUGIN_DIR 'admin/wp-accedeme-admin.php';
        
    $admin = new wp_accedeme_admin();
    }
    else
    {
        
    // Load the popup in the footer
        
    require_once PLUGIN_DIR 'includes/wp-accedeme-footer.php';
        
    $footer = new wp_accedeme_footer();
    }
    So, if being on the WP dashboard or is editing with DIVI don't load our popup, load the admin part.

    This is the logic, but something I'm doing wrong because DIVI still tries to edit the popup when editing an entry.

    Here you have a video with the behaviour using this code. Sorry for my pronunciation.

    https://accedeme.com/assets/images/video1126817684.mp4

    Thanks for your attention.
     
    1. PRO MEMBER PERKS Divi Block Pro - 30+ premade custom header designs for you to choose from:View Demo
  8. Divi.Help

    Divi.Help Administrator
    Staff Member

    One of the easiest fix is to hide your custom div using CSS. Paste it in WP Admin > Divi > Theme Options > Custom CSS:
    Code:
    Log In or Sign Up to view this code.
    **Replace .YOURCSSCLASS with your custom div css class.
     
  9. CarlosCusi

    CarlosCusi New Member

    Thanks mate,

    There are more than 2.000 plugin installations, I can't explain all DIVI user this. Hope you understand this.

    It has to be something inside the plugin code.

    I'm not very experienced with WP. Can I do this inside my plugin?.
     
    1. PRO MEMBER PERKS Divi.Help Header AI Generator - Try the power of AI to generate a custom Divi header for you:Try Now
  10. Divi.Help

    Divi.Help Administrator
    Staff Member

    Then place it in your plugin CSS file? Your plugin should have enqueue any CSS file.

    Basically, the CSS code will hide your div when it's in Divi Builder. Remember to replace .YOURCSSCLASS with your custom div css class.