Skip to content

Commit

Permalink
Merge pull request #69 from bu-ist/release/1.2.23
Browse files Browse the repository at this point in the history
Release 1.2.23
  • Loading branch information
jdub233 authored Oct 14, 2020
2 parents c05e742 + ac5fcb1 commit b6fd5c6
Show file tree
Hide file tree
Showing 7 changed files with 569 additions and 376 deletions.
10 changes: 5 additions & 5 deletions bu-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Boston University (IS&T)
* Author URI: http://sites.bu.edu/web/
* Description: Provides alternative navigation elements designed for blogs with large page counts
* Version: 1.2.22
* Version: 1.2.23
* Text Domain: bu-navigation
* Domain Path: /languages
* License: GPL2+
Expand All @@ -16,7 +16,7 @@

/**
* Copyright 2014 by Boston University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand Down Expand Up @@ -81,7 +81,7 @@ class BU_Navigation_Plugin {
*
* @var string
*/
const VERSION = '1.2.22';
const VERSION = '1.2.23';

/**
* Plugin class constructor.
Expand Down Expand Up @@ -171,7 +171,7 @@ public function load_widget() {
return;
}

require_once dirname( __FILE__ ) . '/bu-navigation-widget.php';
require_once dirname( __FILE__ ) . '/class-bu-widget-pages.php';
register_widget( 'BU_Widget_Pages' );

}
Expand Down Expand Up @@ -281,7 +281,7 @@ public function supported_post_types( $include_link = false, $output = 'names' )
$post_types = apply_filters( 'bu_navigation_post_types', $post_types );

if ( $this->supports( 'links' ) && $include_link ) {
if ( 'names' == $output ) {
if ( 'names' === $output ) {
$post_types[ BU_NAVIGATION_LINK_POST_TYPE ] = BU_NAVIGATION_LINK_POST_TYPE;
} else {
$post_types[ BU_NAVIGATION_LINK_POST_TYPE ] = get_post_type_object( BU_NAVIGATION_LINK_POST_TYPE );
Expand Down
13 changes: 10 additions & 3 deletions bu-navigation-widget.php → class-bu-widget-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public function __construct() {
/**
* Returns HTML fragment containing a section title
*
* Uses bu_navigation_gather_sections, bu_navigation_get_pages, bu_navigation_pages_by_parent, bu_navigation_get_label
* from includes/library.php
* @see bu_navigation_get_label() from extras/bu-navigation-labels.php
*
* @param WP_Post $post Root post as passed through global to the widget() method.
* @param array $instance widget instance args, as passed to WP_Widget::widget.
Expand Down Expand Up @@ -104,7 +103,7 @@ public function section_title( $post, $instance ) {
*
* Gets the title and href from the site and returns them formatted for use as a widget title.
* It is a protected convenience method to make it easier to give section_title multiple early return options.
* There are more than one condition that make section_title want to return the overall site title
* There is more than one condition that causes section_title to return the overall site title
* as the widget title.
*
* @since 1.2.22
Expand All @@ -121,6 +120,9 @@ protected function get_site_title( $wrapped_title_format ) {
/**
* Echos the content navigation widget content, overrides parent method.
*
* @see bu_navigation_supported_post_types() from library.php
* @see bu_navigation_list_pages() from library.php
*
* @param array $args Display arguments for WP_Widget.
* @param array $instance The settings for the particular instance of the widget.
*/
Expand Down Expand Up @@ -295,6 +297,9 @@ protected function get_list_args( $post, $instance ) {
*
* @since 1.2.22
*
* @see bu_navigation_get_pages() from library.php
* @see bu_navigation_pages_by_parent() from library.php
*
* @param array $sections Array of post ids.
* @param string $post_type Post type of the post being rendered.
* @return string Post Id of the grandparent post for the widget title.
Expand Down Expand Up @@ -335,6 +340,8 @@ protected function get_adaptive_section_id( $sections, $post_type ) {
*
* @since 1.2.22
*
* @see bu_navigation_gather_sections() from library.php
*
* @param WP_Post $post The post object as passed to the the widget() method.
* @param string $nav_style The navigation style of the widget (mode).
* @return int Either a post id for the title post, or zero if there is no appropriate match.
Expand Down
Loading

0 comments on commit b6fd5c6

Please sign in to comment.