public static function create($post)
    {
        // If numeric, create the post
        if (is_numeric($post)) {
            // Retrieve the transient
            $transientKey = sprintf('WPMVC\Models\Post(%d)', $post);
            $storedData = WP::getTransient($transientKey);
            // If the transient doesn't yet exist, query for it!
            if ($storedData === false) {
                // Retrieve the post object
                $post = WP::getPost(intval($post));
                // Store the transient
                WP::setTransient($transientKey, $post, static::$transientTimeout);
            } else {
                $post = $storedData;
            }
        } elseif (is_array($post)) {
            // Convert array into object
            $post = (object) $post;
        }
        return new static($post);
    }
public static function create($post)
    {
        // If numeric, create the post
        if (is_numeric($post)) {
            // Retrieve the transient
            $transientKey = sprintf('WPMVC\Models\Post(%d)', $post);
            $storedData = WP::getTransient($transientKey);
            // If the transient doesn't yet exist, query for it!
            if ($storedData === false) {
                // Retrieve the post object
                $post = WP::getPost(intval($post));
                // Store the transient
                WP::setTransient($transientKey, $post, static::$transientTimeout);
            } else {
                $post = $storedData;
            }
        } elseif (is_array($post)) {
            // Convert array into object
            $post = (object) $post;
        }
        return new static($post);
    }
public static function create ( $ post ) { // If numeric, create the post if ( is_numeric ( $ post ) ) { // Retrieve the transient $ transientKey = sprintf ( 'WPMVC\Models\Post(%d)' , $ post ) ; $ storedData = WP :: getTransient ( $ transientKey ) ; // If the transient doesn't yet exist, query for it! if ( $ storedData === false ) { // Retrieve the post object $ post = WP :: getPost ( intval ( $ post ) ) ; // Store the transient WP :: setTransient ( $ transientKey , $ post , static :: $ transientTimeout ) ; } else { $ post = $ storedData ; } } elseif ( is_array ( $ post ) ) { // Convert array into object $ post = ( object ) $ post ; } return new static ( $ post ) ; }
Creates a new instance by the post ID

@access public
@param array|int|WP_Post $postId
@return static
Creates a new instance by the post ID