Skip to content

Commit

Permalink
Merge pull request #110 from markisadesignerd/master
Browse files Browse the repository at this point in the history
Fixed calendar admin screen style embedding if no Event Categories are defined.
  • Loading branch information
stephenharris committed Jul 24, 2013
2 parents 7a281d8 + 2ed05c2 commit 18931e6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions event-organiser-calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,22 @@ function page_scripts(){
* Prints page styles
*/
function page_styles(){
$css = '';
if ( $terms = get_terms( 'event-category', array( 'hide_empty' => 0 ) ) ):
$css = '';
foreach ( $terms as $term ):
$slug = sanitize_html_class( $term->slug );
$color = esc_attr( eo_get_category_color( $term ) );
$css .= ".cat-slug-{$slug} span.ui-selectmenu-item-icon{ background: {$color}; }\n";
endforeach;
wp_enqueue_style( 'eo_calendar-style' );
wp_enqueue_style( 'eventorganiser-style' );
//See trac ticket: http://core.trac.wordpress.org/ticket/24813
if( !defined( 'SCRIPT_DEBUG' ) || !SCRIPT_DEBUG ){
$css = "<style type='text/css'>\n" . $css . "</style>";
}
wp_add_inline_style( 'eo_calendar-style', $css );

endif;

wp_enqueue_style( 'eo_calendar-style' );
wp_enqueue_style( 'eventorganiser-style' );
//See trac ticket: http://core.trac.wordpress.org/ticket/24813
if( !defined( 'SCRIPT_DEBUG' ) || !SCRIPT_DEBUG ){
$css = "<style type='text/css'>\n" . $css . "</style>";
wp_add_inline_style( 'eo_calendar-style', $css );
}
}

function page_actions(){
Expand Down Expand Up @@ -273,7 +273,7 @@ function display(){
<input type="hidden" name="eo_event[allday]">
<?php wp_nonce_field( 'eventorganiser_calendar_save' ); ?>
<?php if ( current_user_can( 'publish_events' ) ):?>
<input type="submit" class="button" tabindex="4" value="<?php _e( 'Save Draft', 'eventorganiser' );?>"" id="event-draft" name="save">
<input type="submit" class="button" tabindex="4" value="<?php _e( 'Save Draft', 'eventorganiser' );?>" id="event-draft" name="save">
<input type="reset" class="button" id="reset" value="<?php _e( 'Cancel', 'eventorganiser' );?>">

<span id="publishing-action">
Expand Down

0 comments on commit 18931e6

Please sign in to comment.