WordPress.org

Plugin Directory

Changeset 627844


Ignore:
Timestamp:
11/20/12 19:17:49 (17 months ago)
Author:
ethitter
Message:

Custom CSS update

Better handling for situations when no CSS exists.

Props cfinke.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/modules/custom-css/custom-css.php

    r619920 r627844  
    516516        return; 
    517517 
     518    $css    = ''; 
    518519    $option = safecss_is_preview() ? 'safecss_preview' : 'safecss'; 
    519520 
     
    521522        if ( get_option( 'safecss_revision_migrated' ) ) { 
    522523            $safecss_post = get_safecss_post(); 
    523             $css = $safecss_post['post_content']; 
     524 
     525            if ( ! empty( $safecss_post['post_content'] ) ) { 
     526                $css = $safecss_post['post_content']; 
     527            } 
    524528        } else { 
    525529            $current_revision = get_current_revision(); 
    526             $css = $current_revision['post_content']; 
     530 
     531            if ( ! empty( $current_revision['post_content'] ) ) { 
     532                $css = $current_revision['post_content']; 
     533            } 
    527534        } 
    528535 
     
    538545    if ( 'safecss_preview' == $option ) { 
    539546        $safecss_post = get_current_revision(); 
    540         $css = $safecss_post['post_content']; 
     547 
     548        if ( !empty( $safecss_post['post_content'] ) ) { 
     549            $css = $safecss_post['post_content']; 
     550        } 
    541551    } 
    542552 
Note: See TracChangeset for help on using the changeset viewer.