diff --git a/codesniffer.ruleset.xml b/codesniffer.ruleset.xml index caf57d000..ed11bfb30 100644 --- a/codesniffer.ruleset.xml +++ b/codesniffer.ruleset.xml @@ -28,10 +28,13 @@ + + + diff --git a/functions.php b/functions.php index ed214ab56..36c2f657f 100644 --- a/functions.php +++ b/functions.php @@ -48,4 +48,7 @@ /** Add Nav Options to Customer */ require_once( 'library/custom-nav.php' ); -?> \ No newline at end of file +/** Add protocol relative theme assets */ +require_once( 'library/protocol-relative-theme-assets.php' ); + +?> diff --git a/library/cleanup.php b/library/cleanup.php index 01491067b..7603f4dc2 100644 --- a/library/cleanup.php +++ b/library/cleanup.php @@ -120,7 +120,7 @@ function foundationpress_remove_recent_comments_style() { // Remove injected CSS from gallery. if ( ! function_exists( 'foundationpress_gallery_style' ) ) : -function foundationpress_gallery_style($css) { +function foundationpress_gallery_style( $css ) { return preg_replace( "!!s", '', $css ); } endif; diff --git a/library/foundation.php b/library/foundation.php index cafc2980e..ea9ca6368 100644 --- a/library/foundation.php +++ b/library/foundation.php @@ -102,17 +102,17 @@ class Foundationpress_Comments extends Walker_Comment{ * You'll have to use this if you plan to get to the top of the comments list, as * start_lvl() only goes as high as 1 deep nested comments */ function __construct() { ?> - +

    - + - +
      - +
    - + - +
  1. id="comment-">
    - - - -
    - + + + +
    + - -
    - + +
    + %s', 'foundationpress' ), get_comment_author_link() ) ?> - +
    - +
    - +
    comment_approved ) : ?>

    -
    +
    - + - +
    $depth, @@ -172,20 +172,20 @@ function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) { comment_reply_link( array_merge( $args, $reply_args ) ); ?>
    - + - + function end_el(& $output, $comment, $depth = 0, $args = array() ) { ?> +
  2. - + - +
- + \n"; } - } endif; -?> \ No newline at end of file +?> diff --git a/library/navigation.php b/library/navigation.php index 4a0876eb7..cdff049b6 100644 --- a/library/navigation.php +++ b/library/navigation.php @@ -64,7 +64,7 @@ function foundationpress_top_bar_r() { * Mobile off-canvas */ if ( ! function_exists( 'foundationpress_mobile_off_canvas' ) ) { - function foundationpress_mobile_off_canvas($direction = 'left') { + function foundationpress_mobile_off_canvas( $direction = 'left' ) { wp_nav_menu(array( 'container' => false, // Remove nav container 'container_class' => '', // Class of container @@ -90,7 +90,7 @@ function foundationpress_mobile_off_canvas($direction = 'left') { * 4) Save Menu. Your menu item will now appear as a button in your top-menu */ if ( ! function_exists( 'foundationpress_add_menuclass' ) ) { - function foundationpress_add_menuclass($ulclass) { + function foundationpress_add_menuclass( $ulclass ) { $find = array('/direction = $direction; } @@ -45,7 +45,6 @@ function start_el( &$output, $object, $depth = 0, $args = array(), $current_obje function start_lvl( &$output, $depth = 0, $args = array() ) { $output .= "\n
    direction}-submenu\">\n
  • ". __( 'Back', 'foundationpress' ) ."
  • \n"; } - } endif; ?> diff --git a/library/protocol-relative-theme-assets.php b/library/protocol-relative-theme-assets.php new file mode 100644 index 000000000..bfdee08bc --- /dev/null +++ b/library/protocol-relative-theme-assets.php @@ -0,0 +1,93 @@ +make_protocol_relative_url( $src ); + } + + /** + * Transform Enqueued JavaScript URLs + * + * @access public + * @return string + * @since 1.0 + */ + public function script_loader_src( $src, $handle ) { + return $this->make_protocol_relative_url( $src ); + } + + /** + * Transform Enqueued Theme Files + * + * @access public + * @return string + * @since 1.0 + * @link http://codex.wordpress.org/Function_Reference/get_template_directory_uri + */ + public function template_directory_uri( $template_dir_uri, $template, $theme_root_uri ) { + return $this->make_protocol_relative_url( $template_dir_uri ); + } + + /** + * Transform Enqueued Theme Files + * + * @access public + * @return string + * @since 1.0 + * @link http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri + */ + public function stylesheet_directory_uri( $stylesheet_dir_uri, $stylesheet, $theme_root_uri ) { + return $this->make_protocol_relative_url( $stylesheet_dir_uri ); + } + } + + $Foundationpress_protocol_relative_theme_assets = new Foundationpress_protocol_relative_theme_assets; +endif; + +?> diff --git a/package.json b/package.json index e13740eb4..36f65c2d4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "foundationpress", "title": "FoundationPress", - "version": "1.1.0", + "version": "1.2.0", "description": "FoundationPress is a WordPress starter theme based on Foundation 5 by Zurb", "keywords": [ "FoundationPress", "WordPress", "starter theme", "Foundation", "semantic", "mobile first", "customizable", "responsive" ], "homepage": "http://foundationpress.olefredrik.com/", diff --git a/style.css b/style.css index 58150a1f2..a1cf8b430 100755 --- a/style.css +++ b/style.css @@ -3,7 +3,7 @@ Theme Name: FoundationPress Theme URI: http://foundationpress.olefredrik.com Github Theme URI: https://github.com/olefredrik/FoundationPress Description: FoundationPress is a WordPress starter theme based on Foundation 5 by Zurb -Version: 1.1.0 +Version: 1.2.0 Author: Ole Fredrik Lie Author URI: http://olefredrik.com/