Changeset 44941 for trunk/src/wp-includes/class-wp-query.php
- Timestamp:
- 03/20/2019 03:48:46 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r44518 r44941 4156 4156 } 4157 4157 4158 $elements = $this->generate_postdata( $post ); 4159 if ( false === $elements ) { 4160 return; 4161 } 4162 4163 $id = $elements['id']; 4164 $authordata = $elements['authordata']; 4165 $currentday = $elements['currentday']; 4166 $currentmonth = $elements['currentmonth']; 4167 $page = $elements['page']; 4168 $pages = $elements['pages']; 4169 $multipage = $elements['multipage']; 4170 $more = $elements['more']; 4171 $numpages = $elements['numpages']; 4172 4173 return true; 4174 } 4175 4176 /** 4177 * Generate post data. 4178 * 4179 * @since 5.2.0 4180 * 4181 * @param WP_Post|object|int $post WP_Post instance or Post ID/object. 4182 * @return array|bool $elements Elements of post or false on failure. 4183 */ 4184 public function generate_postdata( $post ) { 4185 4186 if ( ! ( $post instanceof WP_Post ) ) { 4187 $post = get_post( $post ); 4188 } 4189 4190 if ( ! $post ) { 4191 return false; 4192 } 4193 4158 4194 $id = (int) $post->ID; 4159 4195 … … 4236 4272 do_action_ref_array( 'the_post', array( &$post, &$this ) ); 4237 4273 4238 return true; 4274 $elements = compact( 'id', 'authordata', 'currentday', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages' ); 4275 4276 return $elements; 4239 4277 } 4240 4278 /**
Note: See TracChangeset
for help on using the changeset viewer.