@@ -6,6 +6,8 @@ class Post
66{
77 protected $ id ;
88
9+ protected $ WP_Post ;
10+
911 /**
1012 * @var string
1113 */
@@ -60,30 +62,35 @@ class Post
6062 */
6163 public function __construct (int $ id )
6264 {
63- $ this ->id = $ id ?: -1 ;
64- $ WP_Post = \get_post ($ this ->id ());
65+ $ this ->id = $ id ?: -1 ;
66+ $ this -> WP_Post = \get_post ($ this ->id ());
6567
66- if (!$ WP_Post ) {
68+ if (!$ this -> WP_Post ) {
6769 return ;
6870 }
6971
70- $ this ->title = \get_the_title ($ WP_Post );
71- $ this ->url = \get_permalink ($ WP_Post );
72- $ this ->slug = $ WP_Post ->post_name ;
73- $ this ->content = $ WP_Post ->post_content ;
74- $ this ->status = $ WP_Post ->post_status ;
75- $ this ->format = \get_post_format ($ WP_Post ) ?: 'standard ' ;
76- $ this ->excerpt = \get_the_excerpt ($ WP_Post );
77- $ this ->date = $ WP_Post ->post_date ;
78- $ this ->dateModified = $ WP_Post ->post_modified ;
79- $ this ->parent = new self ($ WP_Post ->post_parent );
72+ $ this ->title = \get_the_title ($ this -> WP_Post );
73+ $ this ->url = \get_permalink ($ this -> WP_Post );
74+ $ this ->slug = $ this -> WP_Post ->post_name ;
75+ $ this ->content = $ this -> WP_Post ->post_content ;
76+ $ this ->status = $ this -> WP_Post ->post_status ;
77+ $ this ->format = \get_post_format ($ this -> WP_Post ) ?: 'standard ' ;
78+ $ this ->excerpt = \get_the_excerpt ($ this -> WP_Post );
79+ $ this ->date = $ this -> WP_Post ->post_date ;
80+ $ this ->dateModified = $ this -> WP_Post ->post_modified ;
81+ $ this ->parent = new self ($ this -> WP_Post ->post_parent );
8082 }
8183
8284 public function id ()
8385 {
8486 return $ this ->id ;
8587 }
8688
89+ public function WP_Post ()
90+ {
91+ return $ this ->WP_Post ;
92+ }
93+
8794 public function url ()
8895 {
8996 return $ this ->url ;
0 commit comments