Skip to content

Commit

Permalink
Bumps version to 1.4.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Bär committed Sep 23, 2016
1 parent b8c4835 commit 3b5b670
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 73 deletions.
28 changes: 15 additions & 13 deletions components/content-section.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
</div>
<?php else : ?>
<nav class="header-navigation">
<ul class="header-links">
<?php wp_list_pages( array(
'child_of' => $post->ID,
'depth' => 1,
'title_li' => '',
'sort_column' => 'menu_order',
) ); ?>
</ul>
<?php if ( has_nav_menu( 'primary' ) ) {
wp_nav_menu( array(
'theme_location' => 'primary',
'sub_menu' => true,
'depth' => '2',
'container' => 'nav',
'container_class' => 'header-links',
'fallback_cb' => 'false',
) );
} ?>
</nav>
<?php endif; ?>
</div>
Expand All @@ -51,22 +53,22 @@
// Loop through the rows of data.
while ( have_rows( 'modules' ) ) : the_row();

if ( get_row_layout() == 'text_image' ) :
if ( get_row_layout() === 'text_image' ) :
get_template_part( 'components/module', 'textimage' );

elseif ( get_row_layout() == 'quote' ) :
elseif ( get_row_layout() === 'quote' ) :

get_template_part( 'components/module', 'quote' );

elseif ( get_row_layout() == 'call_to_action' ) :
elseif ( get_row_layout() === 'call_to_action' ) :

get_template_part( 'components/module', 'calltoaction' );

elseif ( get_row_layout() == 'video' ) :
elseif ( get_row_layout() === 'video' ) :

get_template_part( 'components/module', 'video' );

elseif ( get_row_layout() == 'google_maps' ) :
elseif ( get_row_layout() === 'google_maps' ) :

get_template_part( 'components/module', 'googlemaps' );

Expand Down
6 changes: 3 additions & 3 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
*/
function uwc_website_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
$wp_customize->add_setting( 'comments', array(
'default' => false,
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_section( 'uwc_website_theme_options' , array(
'title' => __( 'Theme Options', 'uwc-website' ),
'priority' => 30,
'title' => __( 'Theme Options', 'uwc-website' ),
'priority' => 30,
) );
$wp_customize->add_control(
'comments',
Expand Down
31 changes: 8 additions & 23 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function ( $matches ) {

/**
* Output a submenu with the child pages of the current page.
* From http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-based-on-parent-or-sibling/
* Adapted from http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-based-on-parent-or-sibling/
*
* @param array $sorted_menu_items The sorted menu defined in the wp_nav_menu.
* @param array $args The arguments defined in the wp_nav_menu call.
Expand All @@ -75,6 +75,7 @@ function uwc_website_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) {
return $sorted_menu_items;
}
$root_id = 0;

// Find the current menu item.
foreach ( $sorted_menu_items as $menu_item ) {
if ( $menu_item->current ) {
Expand All @@ -84,36 +85,20 @@ 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 ) {
foreach ( $sorted_menu_items as $menu_item ) {
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;
}
break;
}
}
}
}

$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;
// Init menu_item_parents.
if ( $item->ID === $root_id ) {
$menu_item_parents[] = $item->ID;
}

if ( in_array( $item->menu_item_parent, $menu_item_parents, true ) ) {
if ( in_array( $item->menu_item_parent, $menu_item_parents ) ) {
// Part of sub-tree: keep!
$menu_item_parents[] = $item->ID;
} elseif ( ! ( isset( $args->show_parent ) && in_array( $item->ID, $menu_item_parents, true ) ) ) {
} elseif ( ! ( isset( $args->show_parent ) && in_array( $item->ID, $menu_item_parents ) ) ) {
// 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 );
3 changes: 1 addition & 2 deletions inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ function uwc_website_the_site_logo() {
function uwc_website_social_menu() {
if ( ! function_exists( 'jetpack_social_menu' ) ) {
return;
} else {
jetpack_social_menu();
}
jetpack_social_menu();
}
31 changes: 13 additions & 18 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,26 @@ function uwc_website_custom_logo() {
* Prints HTML with links to previous and next pages for the current page.
*/
function uwc_website_page_navigation() {
$test = wp_get_nav_menu_items( 'header' );
$menu_location = 'primary';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_location ] );
$pagelist = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );

$pagelist = get_pages( array(
'sort_column' => 'menu_order',
'sort_order' => 'asc',
) );
$pages = array();
foreach ( $pagelist as $page ) {
$pages[] += $page->ID;
}
$current = array_search( get_the_ID(), array_column( $pagelist, 'object_id' ) );

$current = array_search( get_the_ID(), $pages );
$prev_id = $pages[ $current - 1 ];
$next_id = $pages[ $current + 1 ];
$previous = $current - 1;
$next = $current + 1;

echo '<nav class="post-navigation">';
echo '<h2 class="screen-reader-text">Beitragsnavigation</h2>';
if ( ! empty( $prev_id ) ) {
if ( ! empty( $previous ) ) {
echo '<div class="nav-previous">';
echo '<a href="', esc_url( get_permalink( $prev_id ) ), '" title="', get_the_title( $prev_id ), '">', get_the_title( $prev_id ), '</a>';
echo '<a href="' . esc_url( $pagelist[ $previous ]->url ) . '" title="' . esc_html( $pagelist[ $previous ]->title ) . '">' . esc_html( $pagelist[ $previous ]->title ) . '</a>';
echo '</div>';
}
if ( ! empty( $next_id ) ) {
if ( ! empty( $next ) ) {
echo '<div class="nav-next">';
echo '<a href="', esc_url( get_permalink( $next_id ) ), '" title="', get_the_title( $next_id ), '">', get_the_title( $next_id ), '</a>';
echo '<a href="' . esc_url( $pagelist[ $next ]->url ) . '" title="' . esc_html( $pagelist[ $next ]->title ) . '">' . esc_html( $pagelist[ $next ]->title ) . '</a>';
echo '</div>';
}
echo '</nav>';
Expand Down Expand Up @@ -136,12 +131,12 @@ function uwc_website_content_navigation( $text ) {
$nodes = $dom->getElementsByTagName( 'a' );
$items = array();
foreach ( $nodes as $node ) {
if ( $node -> hasAttribute( 'id' ) == true ) {
if ( $node -> hasAttribute( 'id' ) === true ) {
$id = $node -> getAttribute( 'id' );
$items[] = html_entity_decode( $id );
}
}
if ( count( $items ) != 0 ) {
if ( count( $items ) !== 0 ) {
echo '<nav class="entry-navigation"><h6>Inhalt</h6><div class="entry-links">';
foreach ( $items as $item ) {
echo '<a href="#', esc_html( urlencode( $item ) ), '" title="', esc_html( $item ), '" data-scroll>', esc_html( $item ), '</a>';
Expand Down
Binary file modified languages/de_DE.mo
Binary file not shown.
10 changes: 5 additions & 5 deletions languages/de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: UWC Website\n"
"Report-Msgid-Bugs-To: https://github.com/uwc/uwc-website/issues\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2016-09-21 10:08+0200\n"
"PO-Revision-Date: 2016-09-23 14:18+0200\n"
"Last-Translator: Connor Bär <[email protected]>\n"
"Language-Team: Made by Connor. <[email protected]>\n"
"Language: de_DE\n"
Expand Down Expand Up @@ -181,20 +181,20 @@ msgstr ""
"Kommentare werden NICHT gelöscht und können somit jederzeit wieder "
"eingeblendet werden."

#: src/inc/template-tags.php:90
#: src/inc/template-tags.php:85
msgid "Previous page"
msgstr "Vorherige Seite"

#: src/inc/template-tags.php:92
#: src/inc/template-tags.php:87
msgid "Next page"
msgstr "Nächste Seite"

#: src/inc/template-tags.php:172
#: src/inc/template-tags.php:167
msgctxt "post date"
msgid "Posted on %s"
msgstr "Gepostet am %s"

#: src/inc/template-tags.php:177
#: src/inc/template-tags.php:172
msgctxt "post author"
msgid "by %s"
msgstr "von %s."
Expand Down
8 changes: 4 additions & 4 deletions languages/uwc-website.pot
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ msgstr ""
msgid "Check the box to hide comments on the frontend. Comments are NOT deleted and can thus be unhidden at any time."
msgstr ""

#: src/inc/template-tags.php:90
#: src/inc/template-tags.php:85
msgid "Previous page"
msgstr ""

#: src/inc/template-tags.php:92
#: src/inc/template-tags.php:87
msgid "Next page"
msgstr ""

#: src/inc/template-tags.php:172
#: src/inc/template-tags.php:167
msgctxt "post date"
msgid "Posted on %s"
msgstr ""

#: src/inc/template-tags.php:177
#: src/inc/template-tags.php:172
msgctxt "post author"
msgid "by %s"
msgstr ""
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
Contributors: [Connor Bär](http://connorbaer.io)

Requires at least: WordPress 4.5
Requires at least: WordPress 4.5, PHP 5.5

Tested up to: WordPress 4.6.1
Tested up to: WordPress 4.6.1, PHP 7.0

Version: 1.4.3
Version: 1.4.4

License: [MIT](#copyright)

Tags: custom-menu, editor-style, featured-image-header, featured-images, post-formats, sticky-post, theme-options, education, translation-ready

## Description

### This theme is still under development and NOT intended for use yet.
_To be updated._

If you are interested in contributing to the development, [drop me a line](mailto:[email protected]).

Expand Down
2 changes: 1 addition & 1 deletion style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b5b670

Please sign in to comment.