• Resolved permcowp

    (@permcowp)


    I ran into the same issue as @johnsteed, where the upload button appears but does nothing.

    By changing the theme from Twenty Twenty Three to Twenty Twenty One, things worked again.

    I think it has something to do with two ampersands being mis-parsed out to an HTML coding, such that the formula they’re part of not working (comes out as a missing token with bad syntax). Because they appear in curly brackets, they aren’t executed.

    Hope that helps any developers out there!

    Thanks, J.

Viewing 1 replies (of 1 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi, put the following code inside functions.php file of your theme (or inside a code snippet if you have Code Snippets plugin):

    if (!function_exists('wfu_js_bank_code')) {
    	function wfu_js_bank_code($params) {
    		global $wfu_js_bank;
    		if ( !is_array($wfu_js_bank) || !isset($params['sid']) || !isset($wfu_js_bank[$params['sid']]) ) return '';
    		$cont = $wfu_js_bank[$params['sid']];
    		return $cont;
    	}
    	add_shortcode("wfu_js_bank", "wfu_js_bank_code");
    }
    if (!function_exists('wfu_after_upload_handler')) {
    	function wfu_file_upload_output_handler($cont) {
    		$cont = preg_replace_callback(
    			'/<script type="text\/javascript">\svar WFU_JS_([0-9]+)=function.*?<\/script>/s',
    			function ($m) {
    				global $wfu_js_bank;
    				if ( !is_array($wfu_js_bank) ) $wfu_js_bank = array();
    				$wfu_js_bank[$m[1]] = $m[0];
    				return '[wfu_js_bank sid="'.$m[1].'"]';
    			},
    			$cont
    		);
    		return $cont;
    	}
    	add_filter('the_content', 'wfu_file_upload_output_handler', 100);
    }

    This should do the trick for Twenty Twenty Two theme and later.

    Regards

    Nickolas

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with some themes / breaks WFU’ is closed to new replies.