Changeset 53715 for trunk/src/wp-includes/post.php
- Timestamp:
- 07/18/2022 05:35:51 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r53685 r53715 1145 1145 // Get parent status prior to trashing. 1146 1146 $post_status = get_post_meta( $post->post_parent, '_wp_trash_meta_status', true ); 1147 1147 1148 if ( ! $post_status ) { 1148 1149 // Assume publish as above. … … 2244 2245 if ( is_scalar( $post_type ) ) { 2245 2246 $post_type = get_post_type_object( $post_type ); 2247 2246 2248 if ( ! $post_type ) { 2247 2249 return false; … … 2287 2289 if ( is_scalar( $post_status ) ) { 2288 2290 $post_status = get_post_status_object( $post_status ); 2291 2289 2292 if ( ! $post_status ) { 2290 2293 return false; … … 2580 2583 function get_post_custom( $post_id = 0 ) { 2581 2584 $post_id = absint( $post_id ); 2585 2582 2586 if ( ! $post_id ) { 2583 2587 $post_id = get_the_ID(); … … 4190 4194 */ 4191 4195 $post_date = wp_resolve_post_date( $postarr['post_date'], $postarr['post_date_gmt'] ); 4196 4192 4197 if ( ! $post_date ) { 4193 4198 if ( $wp_error ) { … … 4863 4868 * @since 2.5.0 4864 4869 * 4865 * @param int|WP_Post $post _idPost ID or post object.4866 */ 4867 function check_and_publish_future_post( $post _id) {4868 $post = get_post( $post _id);4870 * @param int|WP_Post $post Post ID or post object. 4871 */ 4872 function check_and_publish_future_post( $post ) { 4873 $post = get_post( $post ); 4869 4874 4870 4875 if ( ! $post ) { … … 4880 4885 // Uh oh, someone jumped the gun! 4881 4886 if ( $time > time() ) { 4882 wp_clear_scheduled_hook( 'publish_future_post', array( $post _id) ); // Clear anything else in the system.4883 wp_schedule_single_event( $time, 'publish_future_post', array( $post _id) );4887 wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); // Clear anything else in the system. 4888 wp_schedule_single_event( $time, 'publish_future_post', array( $post->ID ) ); 4884 4889 return; 4885 4890 } 4886 4891 4887 4892 // wp_publish_post() returns no meaningful value. 4888 wp_publish_post( $post _id);4893 wp_publish_post( $post->ID ); 4889 4894 } 4890 4895 … … 5376 5381 function wp_after_insert_post( $post, $update, $post_before ) { 5377 5382 $post = get_post( $post ); 5383 5378 5384 if ( ! $post ) { 5379 5385 return; … … 5404 5410 * 5405 5411 * @since 1.5.0 5406 * @since 4.7.0 `$post _id` can be a WP_Post object.5412 * @since 4.7.0 `$post` can be a WP_Post object. 5407 5413 * @since 4.7.0 `$uri` can be an array of URIs. 5408 5414 * 5409 5415 * @global wpdb $wpdb WordPress database abstraction object. 5410 5416 * 5411 * @param int|WP_Post $post _id Post object or ID.5412 * @param string|array $uri Ping URI or array of URIs.5417 * @param int|WP_Post $post Post ID or post object. 5418 * @param string|array $uri Ping URI or array of URIs. 5413 5419 * @return int|false How many rows were updated. 5414 5420 */ 5415 function add_ping( $post _id, $uri ) {5421 function add_ping( $post, $uri ) { 5416 5422 global $wpdb; 5417 5423 5418 $post = get_post( $post _id);5424 $post = get_post( $post ); 5419 5425 5420 5426 if ( ! $post ) { … … 5487 5493 * @since 1.5.0 5488 5494 * 5489 * @since 4.7.0 `$post _id` can be a WP_Post object.5490 * 5491 * @param int|WP_Post $post _idPost ID or object.5495 * @since 4.7.0 `$post` can be a WP_Post object. 5496 * 5497 * @param int|WP_Post $post Post ID or object. 5492 5498 * @return string[]|false Array of URLs already pinged for the given post, false if the post is not found. 5493 5499 */ 5494 function get_pung( $post _id) {5495 $post = get_post( $post _id);5500 function get_pung( $post ) { 5501 $post = get_post( $post ); 5496 5502 5497 5503 if ( ! $post ) { … … 5516 5522 * 5517 5523 * @since 1.5.0 5518 * @since 4.7.0 `$post _id` can be a WP_Post object.5519 * 5520 * @param int|WP_Post $post _id Post Object or ID5524 * @since 4.7.0 `$post` can be a WP_Post object. 5525 * 5526 * @param int|WP_Post $post Post ID or post object. 5521 5527 * @return string[]|false List of URLs yet to ping. 5522 5528 */ 5523 function get_to_ping( $post _id) {5524 $post = get_post( $post _id);5529 function get_to_ping( $post ) { 5530 $post = get_post( $post ); 5525 5531 5526 5532 if ( ! $post ) { … … 7079 7085 foreach ( $post_types as $post_type ) { 7080 7086 $post_type_obj = get_post_type_object( $post_type ); 7087 7081 7088 if ( ! $post_type_obj ) { 7082 7089 continue; … … 7093 7100 */ 7094 7101 $cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' ); 7102 7095 7103 if ( ! $cap ) { 7096 7104 $cap = current_user_can( $post_type_obj->cap->read_private_posts ); … … 7099 7107 // Only need to check the cap if $public_only is false. 7100 7108 $post_status_sql = "post_status = 'publish'"; 7109 7101 7110 if ( false === $public_only ) { 7102 7111 if ( $cap ) { … … 7640 7649 function wp_get_post_parent_id( $post = null ) { 7641 7650 $post = get_post( $post ); 7651 7642 7652 if ( ! $post || is_wp_error( $post ) ) { 7643 7653 return false; 7644 7654 } 7655 7645 7656 return (int) $post->post_parent; 7646 7657 }
Note: See TracChangeset
for help on using the changeset viewer.