Making WordPress.org


Ignore:
Timestamp:
03/03/2021 04:57:29 AM (5 years ago)
Author:
dd32
Message:

Theme Directory: Simplify the WPORG_Themes_Repo_Package by combining the base & theme-specific class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-repo-package.php

    r9303 r10740  
    44 * Class WPORG_Themes_Repo_Package
    55 *
    6  * The WPORG_Themes_Repo_Package class extends the base package class for theme-specific info.
     6 * The WPORG_Themes_Repo_Package class wraps the WP_Post class with theme-specific info.
    77 * You can create one with new and pass it either a post or post id.
    88 */
    9 class WPORG_Themes_Repo_Package extends Repo_Package {
     9class WPORG_Themes_Repo_Package {
     10
     11        /**
     12         * Holds a WP_Post object representing this post.
     13         *
     14         * @var WP_Post
     15         */
     16        public $wp_post;
     17
     18        /**
     19         * Construct a new Package for the given post ID or object.
     20         *
     21         * @param WP_Post|int $post
     22         */
     23        public function __construct( $post = 0 ) {
     24                if ( $post ) {
     25                        $this->wp_post = get_post( $post );
     26                }
     27        }
    1028
    1129        /**
Note: See TracChangeset for help on using the changeset viewer.