Plugin Directory

Changeset 1735786


Ignore:
Timestamp:
09/25/2017 07:51:53 PM (9 years ago)
Author:
Studiofreya
Message:

ver 2.4

Location:
sf-bootstrap-menu/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sf-bootstrap-menu/trunk/readme.txt

    r1664221 r1735786  
    33Tags: child, pages, hierarchical, menu, sidebar, horizontal, top, bootstrap, responsive, list
    44Requires at least: 3.8
    5 Tested up to: 4.7.5
     5Tested up to: 4.8.2
    66Stable tag: trunk
    77
  • sf-bootstrap-menu/trunk/sf-menu-widget.php

    r1665301 r1735786  
    1111            'alignment'         => '1',
    1212            'show_root'         => true,
     13            'show_root_only'    => false,
    1314            'expanded'          => false,
    1415            'child_of'          => '',
     
    5657    if (!empty($my_includes)) {   
    5758        foreach($my_includes as $parent) {
    58             if (isset($args['show_root']) && $args['show_root'] == 'yes') {
     59            if ((isset($args['show_root']) && $args['show_root'] == 'yes')
     60                || (isset($args['show_root_only']) && $args['show_root_only'] == 'yes')){
    5961                array_push($pageids, $parent);
    6062            }
    6163           
    62             $args_child=array(
    63                 'post_type'   => 'page',
    64                 'post_parent' => $parent,
    65                 'orderby'     => 'menu_order',
    66                 'order'   => 'ASC',
    67             );
    68             $child_pages = new WP_Query( $args_child );
    69            
    70             while ( $child_pages->have_posts() ) {
    71                 $child_pages->the_post();
    72                 $r = get_the_ID();
    73                 //echo "pp: $r, ";
    74                 array_push($pageids, $r);
     64            if(!isset($args['show_root_only']) || $args['show_root_only'] == 'no') {
     65                $args_child=array(
     66                    'post_type'   => 'page',
     67                    'post_parent' => $parent,
     68                    'orderby'     => 'menu_order',
     69                    'order'   => 'ASC',
     70                );
     71                $child_pages = new WP_Query( $args_child );
     72               
     73                while ( $child_pages->have_posts() ) {
     74                    $child_pages->the_post();
     75                    $r = get_the_ID();
     76                    //echo "pp: $r, ";
     77                    array_push($pageids, $r);
     78                }
    7579            }
    7680           
     
    189193        foreach($my_includes as $parent) {
    190194       
    191             if (isset($args['show_root']) && $args['show_root'] == 'yes') {
     195            if ((isset($args['show_root']) && $args['show_root'] == 'yes')
     196                || (isset($args['show_root_only']) && $args['show_root_only'] == 'yes')){
    192197                array_push($pageids, $parent);
    193198            }
    194199           
    195             $args_child=array(
    196                 'child_of' => $parent
    197             );
    198             $pages = get_pages($args_child);
    199            
    200             foreach ($pages as $page) {
    201                 array_push($pageids, $page->ID);
     200            if(!isset($args['show_root_only']) || $args['show_root_only'] == 'no') {
     201                $args_child=array(
     202                    'child_of' => $parent
     203                );
     204                $pages = get_pages($args_child);
     205               
     206                foreach ($pages as $page) {
     207                    array_push($pageids, $page->ID);
     208                }
    202209            }
    203210        }
     
    309316                        'desc' => __("List of root page IDs to show", $tdom)),
    310317            'show_root' => array('title' => __("Show top-level pages:", $tdom),
     318                          'type' => 'checkbox'),
     319            'show_root_only' => array('title' => __("Show top-level pages only:", $tdom),
    311320                          'type' => 'checkbox'),
    312321            'expanded' => array('title' => __("Always expanded:", $tdom),
     
    388397   
    389398    if(!is_writable($path)) {
    390         $instance['error'] = "Could not save dynamic css file. Required plugin path ($path) is not writable. We need it to store dynamic CSS file.";
     399        $instance['error'] = "Could not save dynamic css file. Required plugin path ($path) is not writable. We need it to store the dynamic CSS file.";
    391400    }
    392401   
  • sf-bootstrap-menu/trunk/sf-menu.php

    r1664221 r1735786  
    44 * Plugin URI: https://studiofreya.com/sf-bootstrap-menu
    55 * Description: Responsive menu for child pages with Bootstrap 3.0
    6  * Version: 2.3
     6 * Version: 2.4
    77 * Author: Studiofreya AS
    88 * Author URI: https://studiofreya.com
Note: See TracChangeset for help on using the changeset viewer.