cForms TinyMCE loading in other plugin pages

Home Forums BulletProof Security Pro cForms TinyMCE loading in other plugin pages

Tagged: ,

Viewing 1 post (of 1 total)
  • Author
  • #12719
    AITpro Admin

    UPDATE:  There is a simpler solution in cForms already >>>

    In your WordPress dashboard, under cForms > Global Settings > WP Editor Button Support, there is a checkbox where you can tick “Fix TinyMCE error” which will solve the problem.

    Older info use the simpler solution above:
    The version of cForms where this code modification was created/added was cForms 14.6.  This issue may already be fixed in newer versions of cForms higher than 14.6.

    The issue was that cForms is hard loading a TinyMCE js script on the BPS Maintenance Mode page and the BPS TinyMCE WYSIWYG editor was not working correctly.  BPS is using the WordPress wp_editor() function to load the TinyMCE WYSIWYG editor and it was being overridden by the cForms TinyMCE js script.  BPS has a built-in function that will dequeue other plugin scripts when they try to load on BPS plugin pages, but since this TinyMCE script in cForms is hard loading this script instead of using wp_enqueue_script to load the js script then the method used to prevent this script from hard loading on BPS plugin pages was to create this condition  if ( !preg_match( '/page=bulletproof-security/', $_SERVER['REQUEST_URI'], $matches) )  in the cForms plugin code, which will now only load the editor_plugin25.js TinyMCE script if the the Request URI is not a BPS plugin page.

    cForms code modification:  File:  /cforms/lib_editor.php code line 32

    ### adding to TinyMCE
    function cforms_plugin($plugins) {
    	global $cforms_root,$wp_db_version;
    	if ( !preg_match( '/page=bulletproof-security/', $_SERVER['REQUEST_URI'], $matches) )
    	if ( $wp_db_version >= 6846 )
    		$plugins['cforms'] = $cforms_root.'/js/editor_plugin25.js';
    		array_push($plugins, "-cforms");
    	return $plugins;
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.