Plugin Directory

Changeset 1369565


Ignore:
Timestamp:
03/11/2016 11:23:47 PM (10 years ago)
Author:
stinkysGTI
Message:

Updated to 1.1 - fixed major bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • super-subpages/super-subpages.php

    r1366863 r1369565  
    11<?php
    22/**
    3 * Plugin Name: Super Subpage Display
    4 * Plugin URI: http://jessemorgan.me/super-subpage-display
    5 * Description: A simple plugin for displaying subpages of the current page, with the options for depth and list style. Can be used as a widget or placed anywhere in a template file using <code>superSubpages()</code> and custom styles can be applied using the class <code>super-subpages</code>.
    6 * Version: 1.0
     3* Plugin Name: Super Subpages
     4* Plugin URI: http://jessemorgan.me/super-subpages
     5* Description: A simple plugin for displaying subpages of the current page, with the options for depth and list style. Can be used as a widget, placed anywhere in a template file using <code>superSubpages()</code>, or inserting the shortcode <code>[super_subpages]</code> on any page and custom styles can be applied using the class <code>super-subpages</code>.
     6* Version: 1.1
    77* Author: Jesse Morgan
    88* Author URI: http://jessemorgan.me/
     
    9090
    9191    <form method="post" action="" id="super-subpages-form">
    92         <!-- input type="text" name="style[]" />
    93         <input type="text" name="style[]" />
    94         <input type="text" name="style[]" />
    95         <input type="text" name="style[]" / -->
    9692        <label for="pages-deep">How many levels deep?</label>
    9793            <input type="number" name="pages-deep" id="pages-deep" min="1" max="4" value="<?php echo esc_attr($getCurrentOptions[0]->levels);?>" /><br />
     
    241237?>
    242238<style>
    243     .super-subpages { list-style-type:<?php echo $getCurrentOptions[0]->style_one; ?>; }
    244     .super-subpages li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_two; ?>; }
    245     .super-subpages li ul li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_three; ?>; }
    246     .super-subpages li ul li ul li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_four; ?>; }
     239    .super-subpages { list-style-type:<?php echo $getCurrentOptions[0]->style_one; ?>; }
     240<?php
     241    if($getCurrentOptions[0]->style_two != ''){
     242        echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_two.'; }';
     243    }
     244    if($getCurrentOptions[0]->style_three != ''){
     245        echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_three.'; }';
     246    }
     247    if($getCurrentOptions[0]->style_four != ''){
     248        echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_four.'; }';
     249    }
     250?>
    247251</style>
    248252<ul class="super-subpages">
    249   <?php echo esc_html($sidelinks); ?>
     253  <?php echo $sidelinks; ?>
    250254</ul>
    251255<?php
     
    297301    <style>
    298302        .super-subpages { list-style-type:<?php echo $getCurrentOptions[0]->style_one; ?>; }
    299         .super-subpages li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_two; ?>; }
    300         .super-subpages li ul li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_three; ?>; }
    301         .super-subpages li ul li ul li ul { list-style-type:<?php echo $getCurrentOptions[0]->style_four; ?>; }
     303    <?php
     304        if($getCurrentOptions[0]->style_two != ''){
     305            echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_two.'; }';
     306        }
     307        if($getCurrentOptions[0]->style_three != ''){
     308            echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_three.'; }';
     309        }
     310        if($getCurrentOptions[0]->style_four != ''){
     311            echo '.super-subpages li ul { list-style-type:'.$getCurrentOptions[0]->style_four.'; }';
     312        }
     313    ?>
    302314    </style>
    303315    <ul class="super-subpages">
    304         <?php echo esc_html($sidelinks); ?>
     316        <?php echo $sidelinks; ?>
    305317    </ul>
    306318<?php
    307319}
    308 ?>
     320
     321add_shortcode('super_subpages','superSubpages');
     322
     323?>
Note: See TracChangeset for help on using the changeset viewer.