WordPress.org

Support

Support » Plugins and Hacks » HTML Editor Reloaded » [Plugin: HTML Editor Reloaded] gives javascript errors on other pages

[Plugin: HTML Editor Reloaded] gives javascript errors on other pages

  • Hi,

    Because the Javascript is enqueued to ALL admin pages, this gives an error on pages that do not have an HTML Editor.

    To fix this, please change the code as follows:

    // add code to the footer section of admin pages
    	function admin_footer() {
    		?>
    		<script>
    		if (jQuery("#wp-content-editor-container").length > 0) {
    			<?php
    
    			// update HTML Editor with custom buttons
    			$options = get_option('html_editor_reloaded');
    
    			for ( $i = 0; $i < count($options['label']); $i++ ) {
    
    				?>
    				QTags.addButton('hed_<?php echo $i; ?>',
    					'<?php echo str_replace('"','&quot;',$options['label'][$i]); ?>',
    					'<?php echo str_replace('"','\"',$options['before'][$i]); ?>',
    					'<?php echo str_replace('"','\"',$options['after'][$i]); ?>',
    					'<?php echo str_replace('"','&quot;',$options['shortcut'][$i]); ?>');
    				<?php
    
    			}
    
    			?>
    
    			QTags.addButton('hed_tabs', 'disable tabs', '', '');
    		}
    		</script>
    		<?php
    	}

    Best wishes,

    Bira

    http://wordpress.org/extend/plugins/html-editor-reloaded/

  • The topic ‘[Plugin: HTML Editor Reloaded] gives javascript errors on other pages’ is closed to new replies.
Skip to toolbar