From 66fcd26b2be85628ef6e5f8c9a5330fdcfc2210d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Connor=20B=C3=A4r?= Date: Wed, 21 Sep 2016 10:21:17 +0200 Subject: [PATCH] Bumps version to 1.4.2. Fixes critical bug that would prevent menus from showing. --- .gitignore | 6 +++--- inc/extras.php | 16 ++++++++-------- languages/de_DE.mo | Bin 4207 -> 4207 bytes languages/de_DE.po | 2 +- readme.txt => readme.md | 16 +++++----------- style.css | 2 +- 6 files changed, 18 insertions(+), 24 deletions(-) rename readme.txt => readme.md (85%) diff --git a/.gitignore b/.gitignore index bd126bc..1f15ef3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # Install by running `npm install` node_modules/ -# Run `gulp` to generate the build directory. -build/ +# Run `gulp` to generate the theme directory. +uwc-website/ # Run `gulp dist` to generate the distribution directory. -dist/ \ No newline at end of file +dist/ diff --git a/inc/extras.php b/inc/extras.php index d005325..d9abbf7 100755 --- a/inc/extras.php +++ b/inc/extras.php @@ -72,7 +72,7 @@ function ( $matches ) { */ function uwc_website_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) { if ( ! isset( $args->sub_menu ) ) { - return; + return $sorted_menu_items; } $root_id = 0; // Find the current menu item. @@ -87,12 +87,12 @@ function uwc_website_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) { // Find the top level parent. if ( ! isset( $args->direct_parent ) ) { $prev_root_id = $root_id; - while ( 0 != $prev_root_id ) { + while ( 0 !== $prev_root_id ) { foreach ( $sorted_menu_items as $menu_item ) { - if ( $menu_item->ID == $prev_root_id ) { + if ( $menu_item->ID === $prev_root_id ) { $prev_root_id = $menu_item->menu_item_parent; // Don't set the root_id to 0 if we've reached the top of the menu. - if ( 0 != $prev_root_id ) { $root_id = $menu_item->menu_item_parent; + if ( 0 !== $prev_root_id ) { $root_id = $menu_item->menu_item_parent; } break; } @@ -103,17 +103,17 @@ function uwc_website_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) { $menu_item_parents = array(); foreach ( $sorted_menu_items as $key => $item ) { // Init menu_item_parents. - if ( $item->ID == $root_id ) { $menu_item_parents[] = $item->ID; + if ( $item->ID === $root_id ) { $menu_item_parents[] = $item->ID; } - if ( in_array( $item->menu_item_parent, $menu_item_parents ) ) { + if ( in_array( $item->menu_item_parent, $menu_item_parents, true ) ) { // Part of sub-tree: keep! $menu_item_parents[] = $item->ID; - } elseif ( ! ( isset( $args->show_parent ) && in_array( $item->ID, $menu_item_parents ) ) ) { + } elseif ( ! ( isset( $args->show_parent ) && in_array( $item->ID, $menu_item_parents, true ) ) ) { // Not part of sub-tree: away with it! unset( $sorted_menu_items[ $key ] ); } + return $sorted_menu_items; } - return $sorted_menu_items; } add_filter( 'wp_nav_menu_objects', 'uwc_website_wp_nav_menu_objects_sub_menu', 10, 2 ); diff --git a/languages/de_DE.mo b/languages/de_DE.mo index b297a6fb62834c3e66c6c0588591b34cb93a9de3..7fbcd1b7dd5ecf9b56c8cf94f0953ccb5072cf17 100755 GIT binary patch delta 19 bcmaE_@LplV84fl>1w#WXgUy#X=CT6-O@RjX delta 19 bcmaE_@LplV84flB1p^B!\n" "Language-Team: Made by Connor. \n" "Language: de_DE\n" diff --git a/readme.txt b/readme.md similarity index 85% rename from readme.txt rename to readme.md index a2452fb..3164ea3 100755 --- a/readme.txt +++ b/readme.md @@ -1,5 +1,4 @@ -[![Build Status](https://travis-ci.org/uwc/uwc-website.svg?branch=development)](https://travis-ci.org/uwc/uwc-website) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c8129049d7374429b9fa6c88fff60376)](https://www.codacy.com/app/connor_baer/uwc-website) +[![Build Status](https://travis-ci.org/uwc/uwc-website.svg?branch=development)](https://travis-ci.org/uwc/uwc-website) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/c8129049d7374429b9fa6c88fff60376)](https://www.codacy.com/app/connor_baer/uwc-website) # A WordPress template for UWC websites. @@ -11,7 +10,7 @@ Requires at least: WordPress 4.5 Tested up to: WordPress 4.6.1 -Version: 1.4.1 +Version: 1.4.2 License: [MIT](#copyright) @@ -23,7 +22,6 @@ Tags: custom-menu, editor-style, featured-image-header, featured-images, post-fo If you are interested in contributing to the development, [drop me a line](mailto:uwc@connorbaer.io). - ## Installation > This theme can only be installed on self-hosted WordPress installations and not on sites that are hosted on wordpress.com. @@ -35,11 +33,9 @@ If you are interested in contributing to the development, [drop me a line](mailt 5. Go to https:// for a guide on how to customize this theme. 6. Navigate to Appearance > Customize in your admin panel and customize to taste. - ## Copyright -The MIT License (MIT) -Copyright (c) 2016 Connor Bär +The MIT License (MIT) Copyright (c) 2016 Connor Bär Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -47,12 +43,10 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---- +-------------------------------------------------------------------------------- UWC Website theme bundles the following third-party resources: -HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas -Licenses: MIT/GPL2 -Source: https://github.com/aFarkas/html5shiv +HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas Licenses: MIT/GPL2 Source: ...and others to be added. diff --git a/style.css b/style.css index 8afe263..8cec568 100755 --- a/style.css +++ b/style.css @@ -5,7 +5,7 @@ Theme URI: https://github.com/uwc/uwc-website Author: Connor Baer Author URI: http://connorbaer.io Description: An open-source website template for UWC. Please request permission before use. -Version: 1.4.1 +Version: 1.4.2 License: MIT License URI: https://opensource.org/licenses/MIT Tags: custom-menu, editor-style, featured-image-header, featured-images, post-formats, sticky-post, theme-options, education, translation-ready