From c5b01c3baca46e7bc6e9f5d4d2ef89d8040568cd Mon Sep 17 00:00:00 2001 From: Konstantin Kovshenin Date: Tue, 14 Aug 2012 10:08:10 +0400 Subject: [PATCH] No need for the $post global in _s_scripts() The wp_attachment_is_image() function will figure out the $post global internally, does not require one to be passed. Makes _s_scripts look cleaner. --- functions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 2224f6be..e9a8d73c 100644 --- a/functions.php +++ b/functions.php @@ -100,8 +100,6 @@ add_action( 'widgets_init', '_s_widgets_init' ); * Enqueue scripts and styles */ function _s_scripts() { - global $post; - wp_enqueue_style( 'style', get_stylesheet_uri() ); wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', true ); @@ -110,7 +108,7 @@ function _s_scripts() { wp_enqueue_script( 'comment-reply' ); } - if ( is_singular() && wp_attachment_is_image( $post->ID ) ) { + if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } }