Changeset 47122 for trunk/src/wp-includes/post.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r47066 r47122 8 8 9 9 // 10 // Post Type Registration10 // Post Type registration. 11 11 // 12 12 … … 716 716 */ 717 717 function get_extended( $post ) { 718 // Match the new style more links.718 // Match the new style more links. 719 719 if ( preg_match( '/<!--more(.*?)?-->/', $post, $matches ) ) { 720 720 list($main, $extended) = explode( $matches[0], $post, 2 ); … … 726 726 } 727 727 728 // leading and trailing whitespace.728 // Leading and trailing whitespace. 729 729 $main = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $main ); 730 730 $extended = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $extended ); … … 1417 1417 } 1418 1418 1419 // Sanitize post type name 1419 // Sanitize post type name. 1420 1420 $post_type = sanitize_key( $post_type ); 1421 1421 … … 1559 1559 1560 1560 $default_capabilities = array( 1561 // Meta capabilities 1561 // Meta capabilities. 1562 1562 'edit_post' => 'edit_' . $singular_base, 1563 1563 'read_post' => 'read_' . $singular_base, … … 2034 2034 if ( ! empty( $parsed_args['include'] ) ) { 2035 2035 $incposts = wp_parse_id_list( $parsed_args['include'] ); 2036 $parsed_args['posts_per_page'] = count( $incposts ); // only the number of posts included2036 $parsed_args['posts_per_page'] = count( $incposts ); // Only the number of posts included. 2037 2037 $parsed_args['post__in'] = $incposts; 2038 2038 } elseif ( ! empty( $parsed_args['exclude'] ) ) { … … 2049 2049 2050 2050 // 2051 // Post meta functions 2051 // Post meta functions. 2052 2052 // 2053 2053 … … 2714 2714 */ 2715 2715 function get_post_mime_types() { 2716 $post_mime_types = array( // array( adj, noun )2716 $post_mime_types = array( // array( adj, noun ) 2717 2717 'image' => array( 2718 2718 __( 'Images' ), … … 4275 4275 // Uh oh, someone jumped the gun! 4276 4276 if ( $time > time() ) { 4277 wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // clear anything else in the system4277 wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // Clear anything else in the system. 4278 4278 wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) ); 4279 4279 return; … … 4833 4833 4834 4834 // 4835 // Page functions 4835 // Page functions. 4836 4836 // 4837 4837 … … 5267 5267 $inclusions = ''; 5268 5268 if ( ! empty( $parsed_args['include'] ) ) { 5269 $child_of = 0; // ignore child_of, parent, exclude, meta_key, and meta_value params if using include5269 $child_of = 0; // Ignore child_of, parent, exclude, meta_key, and meta_value params if using include. 5270 5270 $parent = -1; 5271 5271 $exclude = ''; … … 5293 5293 if ( ! empty( $post_authors ) ) { 5294 5294 foreach ( $post_authors as $post_author ) { 5295 // Do we have an author id or an author login?5295 // Do we have an author id or an author login? 5296 5296 if ( 0 == intval( $post_author ) ) { 5297 5297 $post_author = get_user_by( 'login', $post_author ); … … 5322 5322 $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )"; 5323 5323 5324 // meta_key and meta_value might be slashed 5324 // meta_key and meta_value might be slashed. 5325 5325 $meta_key = wp_unslash( $meta_key ); 5326 5326 $meta_value = wp_unslash( $meta_value ); … … 5462 5462 wp_cache_set( $cache_key, $page_structure, 'posts' ); 5463 5463 5464 // Convert to WP_Post instances 5464 // Convert to WP_Post instances. 5465 5465 $pages = array_map( 'get_post', $pages ); 5466 5466 … … 5477 5477 5478 5478 // 5479 // Attachment functions 5479 // Attachment functions. 5480 5480 // 5481 5481 … … 5834 5834 $url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file ); 5835 5835 } elseif ( false !== strpos( $file, 'wp-content/uploads' ) ) { 5836 // Get the directory name relative to the basedir (back compat for pre-2.7 uploads) 5836 // Get the directory name relative to the basedir (back compat for pre-2.7 uploads). 5837 5837 $url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . wp_basename( $file ); 5838 5838 } else { … … 6354 6354 } elseif ( $id == (int) $post_author ) { 6355 6355 $post_status_sql .= " OR post_status = 'private'"; 6356 } // else none6357 } // else none6356 } // Else none. 6357 } // Else none. 6358 6358 } 6359 6359 … … 6713 6713 6714 6714 // 6715 // Hooks 6715 // Hooks. 6716 6716 // 6717 6717 … … 6875 6875 $loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent ); 6876 6876 if ( ! $loop ) { 6877 return $post_parent; // No loop 6877 return $post_parent; // No loop. 6878 6878 } 6879 6879
Note: See TracChangeset
for help on using the changeset viewer.