From 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 16:19:29 -0500 Subject: dos2unix on all .php files, begin paring down admin page and site branding. --- inc/core/class-astra-walker-page.php | 274 +++++++++++++++++------------------ 1 file changed, 137 insertions(+), 137 deletions(-) (limited to 'inc/core/class-astra-walker-page.php') diff --git a/inc/core/class-astra-walker-page.php b/inc/core/class-astra-walker-page.php index b4d0082..ecaf99c 100644 --- a/inc/core/class-astra-walker-page.php +++ b/inc/core/class-astra-walker-page.php @@ -1,137 +1,137 @@ -{$n}"; - $output = apply_filters( 'astra_caret_wrap_filter', $output, $args['sort_column'] ); - - } - - /** - * Outputs the beginning of the current element in the tree. - * - * @see Walker::start_el() - * @since 1.7.2 - * - * @param string $output Used to append additional content. Passed by reference. - * @param WP_Post $page Page data object. - * @param int $depth Optional. Depth of page. Used for padding. Default 0. - * @param array $args Optional. Array of arguments. Default empty array. - * @param int $current_page Optional. Page ID. Default 0. - */ - public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { - $css_class = array( 'page_item', 'page-item-' . $page->ID ); - $icon = ''; - $mobile_icon = ''; - - if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { - $css_class[] = 'menu-item-has-children'; - $icon = Astra_Icons::get_icons( 'arrow' ); - $icon = '' . $icon . ''; - // Add toggle button if menu is from Astra. - if ( true === is_object( $args ) ) { - if ( isset( $args->theme_location ) && - ( 'primary' === $args->theme_location || - 'above_header_menu' === $args->theme_location || - 'below_header_menu' === $args->theme_location ) - ) { - $mobile_icon = ''; - } - } else { - if ( isset( $page->post_parent ) && 0 === $page->post_parent ) { - $mobile_icon = ''; - } - } - } - - if ( ! empty( $current_page ) ) { - $_current_page = get_post( $current_page ); - if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { - $css_class[] = 'current-menu-ancestor'; - } - if ( $page->ID == $current_page ) { - $css_class[] = 'current-menu-item'; - } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { - $css_class[] = 'current-menu-parent'; - } - } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { - $css_class[] = 'current-menu-parent'; - } - - $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); - - $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; - $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; - - $output .= sprintf( - '
  • %s%s%s%s%s', - $css_classes, - get_permalink( $page->ID ), - $args['link_before'], - apply_filters( 'the_title', $page->post_title, $page->ID ), - $args['link_after'], - $icon, - $mobile_icon - ); - } - } - -} +{$n}"; + $output = apply_filters( 'astra_caret_wrap_filter', $output, $args['sort_column'] ); + + } + + /** + * Outputs the beginning of the current element in the tree. + * + * @see Walker::start_el() + * @since 1.7.2 + * + * @param string $output Used to append additional content. Passed by reference. + * @param WP_Post $page Page data object. + * @param int $depth Optional. Depth of page. Used for padding. Default 0. + * @param array $args Optional. Array of arguments. Default empty array. + * @param int $current_page Optional. Page ID. Default 0. + */ + public function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) { + $css_class = array( 'page_item', 'page-item-' . $page->ID ); + $icon = ''; + $mobile_icon = ''; + + if ( isset( $args['pages_with_children'][ $page->ID ] ) ) { + $css_class[] = 'menu-item-has-children'; + $icon = Astra_Icons::get_icons( 'arrow' ); + $icon = '' . $icon . ''; + // Add toggle button if menu is from Astra. + if ( true === is_object( $args ) ) { + if ( isset( $args->theme_location ) && + ( 'primary' === $args->theme_location || + 'above_header_menu' === $args->theme_location || + 'below_header_menu' === $args->theme_location ) + ) { + $mobile_icon = ''; + } + } else { + if ( isset( $page->post_parent ) && 0 === $page->post_parent ) { + $mobile_icon = ''; + } + } + } + + if ( ! empty( $current_page ) ) { + $_current_page = get_post( $current_page ); + if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) { + $css_class[] = 'current-menu-ancestor'; + } + if ( $page->ID == $current_page ) { + $css_class[] = 'current-menu-item'; + } elseif ( $_current_page && $page->ID == $_current_page->post_parent ) { + $css_class[] = 'current-menu-parent'; + } + } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { + $css_class[] = 'current-menu-parent'; + } + + $css_classes = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) ); + + $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before']; + $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after']; + + $output .= sprintf( + '
  • %s%s%s%s%s', + $css_classes, + get_permalink( $page->ID ), + $args['link_before'], + apply_filters( 'the_title', $page->post_title, $page->ID ), + $args['link_after'], + $icon, + $mobile_icon + ); + } + } + +} -- cgit v1.2.3-60-g2f50