]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-walker-page.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / class-walker-page.php
index 3b3ca3189d937957a6545228f63ecad035c044bb..f4667c57b41f9514faa4f1a9e3c048804ecfef40 100644 (file)
  * @see Walker
  */
 class Walker_Page extends Walker {
+
        /**
-        * @see Walker::$tree_type
+        * What the class handles.
+        *
         * @since 2.1.0
+        * @access public
         * @var string
+        *
+        * @see Walker::$tree_type
         */
        public $tree_type = 'page';
 
        /**
-        * @see Walker::$db_fields
+        * Database fields to use.
+        *
         * @since 2.1.0
-        * @todo Decouple this.
+        * @access private
         * @var array
+        *
+        * @see Walker::$db_fields
+        * @todo Decouple this.
         */
-       public $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
+       public $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
 
        /**
-        * @see Walker::start_lvl()
+        * Outputs the beginning of the current level in the tree before elements are output.
+        *
         * @since 2.1.0
+        * @access public
+        *
+        * @see Walker::start_lvl()
         *
         * @param string $output Passed by reference. Used to append additional content.
-        * @param int    $depth  Depth of page. Used for padding.
-        * @param array  $args
+        * @param int    $depth  Optional. Depth of page. Used for padding. Default 0.
+        * @param array  $args   Optional. Arguments for outputing the next level.
+        *                       Default empty array.
         */
        public function start_lvl( &$output, $depth = 0, $args = array() ) {
                $indent = str_repeat("\t", $depth);
@@ -44,12 +58,17 @@ class Walker_Page extends Walker {
        }
 
        /**
-        * @see Walker::end_lvl()
+        * Outputs the end of the current level in the tree after elements are output.
+        *
         * @since 2.1.0
+        * @access public
+        *
+        * @see Walker::end_lvl()
         *
         * @param string $output Passed by reference. Used to append additional content.
-        * @param int    $depth  Depth of page. Used for padding.
-        * @param array  $args
+        * @param int    $depth  Optional. Depth of page. Used for padding. Default 0.
+        * @param array  $args   Optional. Arguments for outputting the end of the current level.
+        *                       Default empty array.
         */
        public function end_lvl( &$output, $depth = 0, $args = array() ) {
                $indent = str_repeat("\t", $depth);
@@ -57,14 +76,17 @@ class Walker_Page extends Walker {
        }
 
        /**
+        * Outputs the beginning of the current element in the tree.
+        *
         * @see Walker::start_el()
         * @since 2.1.0
+        * @access public
         *
-        * @param string $output       Passed by reference. Used to append additional content.
-        * @param object $page         Page data object.
-        * @param int    $depth        Depth of page. Used for padding.
-        * @param int    $current_page Page ID.
-        * @param array  $args
+        * @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 ) {
                if ( $depth ) {
@@ -101,7 +123,7 @@ class Walker_Page extends Walker {
                 * @see wp_list_pages()
                 *
                 * @param array   $css_class    An array of CSS classes to be applied
-                *                             to each list item.
+                *                              to each list item.
                 * @param WP_Post $page         Page data object.
                 * @param int     $depth        Depth of page, used for padding.
                 * @param array   $args         An array of arguments.
@@ -117,12 +139,12 @@ class Walker_Page extends Walker {
                $args['link_before'] = empty( $args['link_before'] ) ? '' : $args['link_before'];
                $args['link_after'] = empty( $args['link_after'] ) ? '' : $args['link_after'];
 
-               /** This filter is documented in wp-includes/post-template.php */
                $output .= $indent . sprintf(
                        '<li class="%s"><a href="%s">%s%s%s</a>',
                        $css_classes,
                        get_permalink( $page->ID ),
                        $args['link_before'],
+                       /** This filter is documented in wp-includes/post-template.php */
                        apply_filters( 'the_title', $page->post_title, $page->ID ),
                        $args['link_after']
                );
@@ -140,13 +162,17 @@ class Walker_Page extends Walker {
        }
 
        /**
-        * @see Walker::end_el()
+        * Outputs the end of the current element in the tree.
+        *
         * @since 2.1.0
+        * @access public
         *
-        * @param string $output Passed by reference. Used to append additional content.
-        * @param object $page Page data object. Not used.
-        * @param int    $depth Depth of page. Not Used.
-        * @param array  $args
+        * @see Walker::end_el()
+        *
+        * @param string  $output Used to append additional content. Passed by reference.
+        * @param WP_Post $page   Page data object. Not used.
+        * @param int     $depth  Optional. Depth of page. Default 0 (unused).
+        * @param array   $args   Optional. Array of arguments. Default empty array.
         */
        public function end_el( &$output, $page, $depth = 0, $args = array() ) {
                $output .= "</li>\n";