Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Damian

    (@timersys)

    But you are having issue with HTML or the whole contest is not saving?

    Thread Starter imagic

    (@imagic)

    Hi Damian, the content is not saving. I am trying to create a popup with only one image.
    I tried another test this time with text and image – it seams only the image disappears, the text remains saved.

    I have also tried on another WP installation and same problem occurs.

    Can you recreate it on your end?

    • This reply was modified 2 years, 1 month ago by imagic.
    Plugin Author Damian

    (@timersys)

    Yes, it’s due to WordPress only allowing admins to use unfiltered HTML so it fails.
    Try adding this in yours functions.php

    add_filter(‘wppopups_save_popup_args’, function($popup){
    remove_filter( ‘content_save_pre’, ‘wp_filter_post_kses’ );
    return $popup;
    });

    Thread Starter imagic

    (@imagic)

    Not working unfortunately. I tried also with default Storefront theme, no luck. When I hit save as a shop manager, images are gone.

    I have this in my functions.php:

    add_filter( 'wppopups/manage_capability', function(){ return 'manage_woocommerce';} );
    
    add_filter('wppopups_save_popup_args', function($popup){
    	remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
    return $popup;
    });
    • This reply was modified 2 years, 1 month ago by imagic.
    Plugin Author Damian

    (@timersys)

    It seems we will need to make an update. If you want to have the change before we launch do the following.

    On wppopups/src/includes/class-popup-handler.php line 311

    Change this:

    		if ( ! current_user_can( 'unfiltered_html' ) ) {
    			$data = map_deep( $data, 'wp_strip_all_tags' );
    		}
    

    To this:

    		if ( ! current_user_can( 'unfiltered_html' ) ) {
    			remove_filter( 'content_save_pre', 'wp_filter_post_kses' );
    		}
    Thread Starter imagic

    (@imagic)

    Hi Damian, that did it! Thank you very much for helping out. Great plugin. Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Popup content disappear and can not save’ is closed to new replies.