• Resolved manuel_84

    (@manuel_84)


    I needed to filter out some more Divi output to avoid Google Maps and other monsters being displayed because coded inside text or code blocks, so I edited this function:

      public function manage_visual_builder_divi() {
        add_filter( 'et_pb_fullwidth_map_shortcode_output', array( $this, 'filter_builder_shortcode_divi_maps' ) );
        add_filter( 'et_pb_map_shortcode_output'          , array( $this, 'filter_builder_shortcode_divi_maps' ) );
        add_filter( 'et_pb_text_shortcode_output'         , array( $this, 'filter_builder_shortcode_divi_html' ) ); // add by manuel
        add_filter( 'et_pb_code_shortcode_output'         , array( $this, 'filter_builder_shortcode_divi_html' ) ); // add by manuel
      }

    and added this one:

      public function filter_builder_shortcode_divi_html( $output ) { //add by manuel
        return $this->buffer_scan($output);
      }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Nicola Modugno

    (@shark986)

    Hello @manuel_84,
    I am sorry, but I think that your implementation does not work.

    The logic is that SCK works in the background, parsing the final page HTML to manage the “elements” that it can recognize. With this logic, the buffer_scan function is already scanning the text/code blocks. Your changes are running again a scan that is not able to recognize some elements.

    The filter_builder_shortcode_divi_maps function and the others similar make specific changes to the HTML, and they works in parallel with buffer_scan. So for that kind of implementation it is necessary to understand what kind of code is present in those code/text blocks and manage it appropriately.
    The frontend file, however, manages only the block of the elements, so changing it does not solve the problem. To unlock elements you should change the SCK js file, too.

    Let me see an example of code to block!

    Nicola

    Thread Starter manuel_84

    (@manuel_84)

    Nicola funziona perché gli fa filtrare contenuti di Divi che prima escludevi (cioè l’output di altri 2 shortcodes), lo sto usando in un sito live.
    Ho scelto gli shortcode di testo e codice perché dentro questi uno può inserire qualsiasi cosa (tipo nel mio caso un iframe di google maps)

    Ciao ??

    • This reply was modified 5 years, 6 months ago by manuel_84.
    • This reply was modified 5 years, 6 months ago by manuel_84.
    • This reply was modified 5 years, 6 months ago by manuel_84.
    Plugin Author Nicola Modugno

    (@shark986)

    Manuel sarei curioso di avere qualche dettaglio in più. Se vuoi, anche in privato.
    Grazie

    Thread Starter manuel_84

    (@manuel_84)

    We found that the problem was related to output buffering and the above code for Divi was not necessary, so the only thing needed was adding this line to sources_to_block:

    array( 'service_name' => 'Google Maps', 'unlock_with' => 'profiling', 'pattern' => 'www.google.com/maps/d/embed' ),

    If someone else like me is using Gantry Framework may find useful to change this to avoid problems with output/buffers:

    add_action( 'after_setup_theme', array( $this, 'buffer_set' ), -99998 ); // wp_head > after_setup_theme
    add_action( 'shutdown', array( $this, 'buffer_unset' ),  99999 ); // wp_footer > shutdown
    • This reply was modified 5 years, 6 months ago by manuel_84.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Added code for Divi builder’ is closed to new replies.