WordPress.org

Ready to get started?Download WordPress

Forums

WP Live CSS Editor
editor left "open" causes admin to break (3 posts)

  1. pingram3541
    Member
    Plugin Author

    Posted 1 year ago #

    I noticed if I leave the editor pane "open" (whether right or down positioned) and do not close it when I go into wp admin area (anywhere) it also tries to open the pane and, at least in chrome, crashes the page. If I go back to the post/page and close the editor pane so it is hidden I can then return to the admin area normally.

    p.s. I know I've posted a lot of stuff but this is a really great idea and I'd like to see it well polished. I may even help you out with a few of these...if time permits. Keep it up =)

    http://wordpress.org/extend/plugins/wp-live-css-editor/

  2. pingram3541
    Member
    Plugin Author

    Posted 1 year ago #

    I was abel to get around this by editing wp-live-css-editor.php line 31

    from:

    add_action('wp_loaded', 'wp_live_css_editor_init');
    function wp_live_css_editor_init(){
       if( current_user_can('delete_themes')  ) //current_user_can('manage_options')
        {
        	add_action('wp_print_styles', 'wp_live_css_editor_enqueue_styles');
        	add_action('wp_print_scripts', 'wp_live_css_editor_enqueue_scripts');
        	add_action('wp_ajax_live_css_editor_SAVE', 'wp_live_css_editor_SAVE');
        }
    }

    to:

    add_action('wp_loaded', 'wp_live_css_editor_init');
    function wp_live_css_editor_init(){
        if(is_admin()) {
            //do nothing if in admin area
        } else{
        	if( current_user_can('delete_themes')  ) //current_user_can('manage_options')
        	{
        		add_action('wp_print_styles', 'wp_live_css_editor_enqueue_styles');
        		add_action('wp_print_scripts', 'wp_live_css_editor_enqueue_scripts');
        		add_action('wp_ajax_live_css_editor_SAVE', 'wp_live_css_editor_SAVE');
        	}
        }
    
    }
  3. pingram3541
    Member
    Plugin Author

    Posted 1 year ago #

    oops, issues with saving the edited css, since we need admin to save, lets only exlcude the script and css files if in admin area

    to:

    add_action('wp_loaded', 'wp_live_css_editor_init');
    function wp_live_css_editor_init(){
    	if( current_user_can('delete_themes')  ) //current_user_can('manage_options')
        	{
        		if(is_admin()) {
        			//do nothing
        		} else {
        			add_action('wp_print_styles', 'wp_live_css_editor_enqueue_styles');
        			add_action('wp_print_scripts', 'wp_live_css_editor_enqueue_scripts');
        		}
        		add_action('wp_ajax_live_css_editor_SAVE', 'wp_live_css_editor_SAVE');
        	}
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.