Making WordPress.org

Changeset 5765


Ignore:
Timestamp:
08/07/2017 07:47:22 PM (9 years ago)
Author:
danielbachhuber
Message:

devhub/cli: Append subcommands in filter so accepted as subhead

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-command.php

    r5763 r5765  
    1717                        ) );
    1818                ?>
    19                 <?php
    20                 $children = get_children( array(
    21                         'post_parent'    => get_the_ID(),
    22                         'post_type'      => 'command',
    23                         'posts_per_page' => 250,
    24                         'orderby'        => 'title',
    25                         'order'          => 'ASC',
    26                 ) );
    27                 if ( $children ) : ?>
    28                         <h3>SUBCOMMANDS</h3>
    29                         <table>
    30                                 <thead>
    31                                 <tr>
    32                                         <th>Name</th>
    33                                         <th>Description</th>
    34                                 </tr>
    35                                 </thead>
    36                                 <tbody>
    37                                         <?php foreach( $children as $child ) : ?>
    38                                                 <tr>
    39                                                         <td><a href="<?php echo apply_filters( 'the_permalink', get_permalink( $child->ID ) ); ?>"><?php echo apply_filters( 'the_title', $child->post_title ); ?></a></td>
    40                                                         <td><?php echo apply_filters( 'the_excerpt', $child->post_excerpt ); ?></td>
    41                                                 </tr>
    42                                         <?php endforeach; ?>
    43                                 </tbody>
    44                         </table>
    45                 <?php endif; ?>
    4619        </div><!-- .entry-content -->
    4720
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli.php

    r5763 r5765  
    273273                }
    274274
     275                // Append subcommands if they exist
     276                $children = get_children( array(
     277                        'post_parent'    => get_the_ID(),
     278                        'post_type'      => 'command',
     279                        'posts_per_page' => 250,
     280                        'orderby'        => 'title',
     281                        'order'          => 'ASC',
     282                ) );
     283                if ( $children ) {
     284                        ob_start();
     285                        ?>
     286                        <h3>SUBCOMMANDS</h3>
     287                        <table>
     288                                <thead>
     289                                <tr>
     290                                        <th>Name</th>
     291                                        <th>Description</th>
     292                                </tr>
     293                                </thead>
     294                                <tbody>
     295                                        <?php foreach( $children as $child ) : ?>
     296                                                <tr>
     297                                                        <td><a href="<?php echo apply_filters( 'the_permalink', get_permalink( $child->ID ) ); ?>"><?php echo apply_filters( 'the_title', $child->post_title ); ?></a></td>
     298                                                        <td><?php echo apply_filters( 'the_excerpt', $child->post_excerpt ); ?></td>
     299                                                </tr>
     300                                        <?php endforeach; ?>
     301                                </tbody>
     302                        </table>
     303                <?php
     304                        $subcommands = ob_get_clean();
     305                        $content .= PHP_EOL . $subcommands;
     306                }
     307
    275308                // Add 'Quick Links' across the top
    276309                $items = self::get_tags( 'h([1-4])', $content );
Note: See TracChangeset for help on using the changeset viewer.