Making WordPress.org

Changeset 833


Ignore:
Timestamp:
09/04/2014 07:33:06 PM (12 years ago)
Author:
coffee2code
Message:

Code Reference: add and use get_long_description() to get parsed long descriptions from meta

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

Legend:

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

    r768 r833  
    1212
    1313        <section class="long-description">
    14                 <?php the_content(); ?>
     14                <?php echo get_long_description(); ?>
    1515        </section>
    1616        <section class="return"><p><strong>Return:</strong> <?php echo get_return(); ?></p></section>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-wp-parser-hook.php

    r768 r833  
    1111
    1212        <section class="long-description">
    13                 <?php the_content(); ?>
     13                <?php echo get_long_description(); ?>
    1414        </section>
    1515
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r814 r833  
    836836        }
    837837
     838        /**
     839         * Gets the long description.
     840         *
     841         * The long description is stored in the 'wporg_parsed_content' meta field.
     842         *
     843         * @param  null|WP_Post Optiona. The post.
     844         * @return string
     845         */
     846        function get_long_description( $post = null ) {
     847                $post = get_post( $post );
     848
     849                if ( $long_description = get_post_meta( $post->ID, 'wporg_parsed_content', true ) ) {
     850                        $long_description = apply_filters( 'the_content', $long_description );
     851                }
     852
     853                return $long_description;
     854        }
     855
    838856}
Note: See TracChangeset for help on using the changeset viewer.