Skip to content
Browse files

fixed small bug on theme settings page. Meta boxes were added to post…

…s when logged in user dindn't have enough privilages
  • Loading branch information...
1 parent 9b14312 commit 0283a7d3fa4d02b602886f7039e0e00efb5c4d6d @madalinungureanu committed Jan 20, 2012
View
3 library/admin/meta-box-archive-display.php
@@ -25,7 +25,8 @@ function bareskin_meta_box_add_archive_display() {
$domain = bareskin_get_textdomain();
/* Adds the Archive Display metabox for the theme. */
- add_meta_box( 'bareskin-archive-display', __( 'Archives Display', $domain ), 'bareskin_meta_box_archive_display', $bareskin_settings_page, 'side', 'high' );
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-archive-display', __( 'Archives Display', $domain ), 'bareskin_meta_box_archive_display', $bareskin_settings_page, 'side', 'high' );
}
View
4 library/admin/meta-box-style-css-compression.php
@@ -26,7 +26,9 @@
*/
function bareskin_meta_box_add_style_minify() {
global $bareskin_settings_page;
- add_meta_box( 'bareskin-meta-box-style-minify', __( 'Style Minify', bareskin_get_textdomain() ), 'bareskin_meta_box_display_style_minify', $bareskin_settings_page, 'normal', 'high' );
+
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-meta-box-style-minify', __( 'Style Minify', bareskin_get_textdomain() ), 'bareskin_meta_box_display_style_minify', $bareskin_settings_page, 'normal', 'high' );
}
View
3 library/admin/meta-box-theme-about.php
@@ -25,7 +25,8 @@ function bareskin_meta_box_theme_add_about() {
$theme_data = get_theme_data( trailingslashit( STYLESHEETPATH ) . 'style.css' );
/* Adds the About box for the theme. */
- add_meta_box( 'bareskin-about-theme', sprintf( __( 'About %1$s', $domain ), $theme_data['Title'] ), 'bareskin_meta_box_theme_display_about', $bareskin_settings_page, 'side', 'high' );
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-about-theme', sprintf( __( 'About %1$s', $domain ), $theme_data['Title'] ), 'bareskin_meta_box_theme_display_about', $bareskin_settings_page, 'side', 'high' );
}
View
4 library/admin/meta-box-theme-css-variations.php
@@ -22,7 +22,9 @@
*/
function bareskin_meta_box_theme_add_color_variations() {
global $bareskin_settings_page;
- add_meta_box( 'bareskin-meta-box-color-variations', __( 'Color Variations', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_color_variations', $bareskin_settings_page, 'normal', 'high' );
+
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-meta-box-color-variations', __( 'Color Variations', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_color_variations', $bareskin_settings_page, 'normal', 'high' );
}
/**
View
3 library/admin/meta-box-theme-font.php
@@ -24,7 +24,8 @@ function bareskin_meta_box_theme_add_font() {
$domain = bareskin_get_textdomain();
/* Adds the About box for the parent theme. */
- add_meta_box( 'bareskin-theme-font', __( 'Font Selection', $domain ), 'bareskin_meta_box_theme_display_font', $bareskin_settings_page, 'side', 'high' );
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-theme-font', __( 'Font Selection', $domain ), 'bareskin_meta_box_theme_display_font', $bareskin_settings_page, 'side', 'high' );
}
View
4 library/admin/meta-box-theme-footer.php
@@ -21,7 +21,9 @@
*/
function bareskin_meta_box_theme_add_footer() {
global $bareskin_settings_page;
- add_meta_box( 'bareskin-core-meta-box-footer', __( 'Footer settings', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_footer', $bareskin_settings_page, 'normal', 'high' );
+
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-core-meta-box-footer', __( 'Footer settings', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_footer', $bareskin_settings_page, 'normal', 'high' );
}
/**
View
4 library/admin/meta-box-theme-logo-and-favicon.php
@@ -22,7 +22,9 @@
*/
function bareskin_meta_box_theme_add_logo_and_favicon() {
global $bareskin_settings_page;
- add_meta_box( 'bareskin-meta-box-logo-and-favicon', __( 'Logo and Favicon', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_logo_and_favicon', $bareskin_settings_page, 'normal', 'high' );
+
+ if( $bareskin_settings_page != null )
+ add_meta_box( 'bareskin-meta-box-logo-and-favicon', __( 'Logo and Favicon', bareskin_get_textdomain() ), 'bareskin_meta_box_theme_display_logo_and_favicon', $bareskin_settings_page, 'normal', 'high' );
}
/**
View
6 library/admin/theme-settings.php
@@ -59,12 +59,14 @@ function bareskin_settings_page_init(){
//add_action( "load-{$bareskin_settings_page}", 'bareskin_load_settings_page_meta_boxes' );
/* Create a hook for adding meta boxes. */
- add_action( "load-{$bareskin_settings_page}", 'bareskin_settings_page_add_meta_boxes' );
+ if( $bareskin_settings_page != null )
+ add_action( "load-{$bareskin_settings_page}", 'bareskin_settings_page_add_meta_boxes' );
/* Load the JavaScript and stylesheets needed for the theme settings screen. */
add_action( 'admin_enqueue_scripts', 'bareskin_settings_page_enqueue_scripts' );
add_action( 'admin_enqueue_scripts', 'bareskin_settings_page_enqueue_styles' );
- add_action( "admin_head-{$bareskin_settings_page}", 'bareskin_settings_page_load_scripts' );
+ if( $bareskin_settings_page != null )
+ add_action( "admin_head-{$bareskin_settings_page}", 'bareskin_settings_page_load_scripts' );
}

0 comments on commit 0283a7d

Please sign in to comment.
Something went wrong with that request. Please try again.