Making WordPress.org


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.