Changeset 64183
- Timestamp:
- 10/06/2026 05:43:31 PM (5 weeks ago)
- Location:
- branches/4.7
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
src/wp-admin/js/common.js (modified) (1 diff)
-
src/wp-includes/class-http.php (modified) (1 diff)
-
src/wp-includes/class-oembed.php (modified) (3 diffs)
-
src/wp-includes/class-wp-query.php (modified) (2 diffs)
-
src/wp-includes/post.php (modified) (1 diff)
-
src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
- Property svn:mergeinfo changed
/trunk merged: 64127-64128,64130-64133
- Property svn:mergeinfo changed
-
branches/4.7/src/wp-admin/js/common.js
r40512 r64183 169 169 link.parent('li').addClass('active'); 170 170 171 panel = $( link.attr('href') );171 panel = $( document ).find( link.attr('href') ); 172 172 173 173 // Panels -
branches/4.7/src/wp-includes/class-http.php
r40690 r64183 945 945 // Strip all /path/../ out of the path. 946 946 while ( strpos( $path, '../' ) > 1 ) { 947 $path = preg_replace( '![^/]+/\.\./!', '', $path ); 947 $path = preg_replace( '![^/]+/\.\./!', '', $path, -1, $segment_replacement_count ); 948 if ( 0 === $segment_replacement_count ) { 949 break; 950 } 948 951 } 949 952 -
branches/4.7/src/wp-includes/class-oembed.php
r38923 r64183 84 84 '#https?://(www\.)?instagr(\.am|am\.com)/p/.*#i' => array( 'https://api.instagram.com/oembed', true ), 85 85 '#https?://(open|play)\.spotify\.com/.*#i' => array( 'https://embed.spotify.com/oembed/', true ), 86 '#https?://(.+\.)?imgur\.com/.*#i' => array( 'http://api.imgur.com/oembed', true ),87 86 '#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'https://api.meetup.com/oembed', true ), 88 87 '#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'https://issuu.com/oembed_wp', true ), … … 156 155 * | Flickr | flic.kr | Yes | 3.6.0 | 157 156 * | Spotify | spotify.com | Yes | 3.6.0 | 158 * | Imgur | imgur.com | Yes | 3.9.0 |159 157 * | Meetup.com | meetup.com | Yes | 3.9.0 | 160 158 * | Meetup.com | meetu.ps | Yes | 3.9.0 | … … 193 191 * | Rdio | rdio.com | Yes | 3.6.0 | 4.4.1 | 194 192 * | Rdio | rd.io | Yes | 3.6.0 | 4.4.1 | 193 * | Imgur | imgur.com | Yes | 3.9.0 | 7.1.3 | 195 194 * 196 195 * @see wp_oembed_add_provider() -
branches/4.7/src/wp-includes/class-wp-query.php
r54566 r64183 2887 2887 } 2888 2888 2889 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) {2890 /** This filter is documented in wp-includes/query.php */2891 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) );2892 2893 /** This filter is documented in wp-includes/query.php */2894 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) );2895 2896 /** This filter is documented in wp-includes/query.php */2897 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) );2898 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';2899 2900 /** This filter is documented in wp-includes/query.php */2901 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );2902 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';2903 2904 /** This filter is documented in wp-includes/query.php */2905 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) );2906 2907 $comments_request = "SELECT {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits";2908 $comments = $wpdb->get_results($comments_request);2909 // Convert to WP_Comment2910 $this->comments = array_map( 'get_comment', $comments );2911 $this->comment_count = count($this->comments);2912 }2913 2914 2889 // Check post status to determine if post should be displayed. 2915 2890 if ( !empty($this->posts) && ($this->is_single || $this->is_page) ) { … … 2960 2935 } 2961 2936 2937 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { 2938 /** This filter is documented in wp-includes/query.php */ 2939 $cjoin = apply_filters_ref_array( 'comment_feed_join', array( '', &$this ) ); 2940 2941 /** This filter is documented in wp-includes/query.php */ 2942 $cwhere = apply_filters_ref_array( 'comment_feed_where', array( "WHERE comment_post_ID = '{$this->posts[0]->ID}' AND comment_approved = '1'", &$this ) ); 2943 2944 /** This filter is documented in wp-includes/query.php */ 2945 $cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( '', &$this ) ); 2946 $cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : ''; 2947 2948 /** This filter is documented in wp-includes/query.php */ 2949 $corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) ); 2950 $corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : ''; 2951 2952 /** This filter is documented in wp-includes/query.php */ 2953 $climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option('posts_per_rss'), &$this ) ); 2954 2955 $comments_request = "SELECT {$wpdb->comments}.* FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits"; 2956 $comments = $wpdb->get_results($comments_request); 2957 // Convert to WP_Comment 2958 $this->comments = array_map( 'get_comment', $comments ); 2959 $this->comment_count = count($this->comments); 2960 } 2961 2962 2962 // Put sticky posts at the top of the posts array 2963 2963 $sticky_posts = get_option('sticky_posts'); -
branches/4.7/src/wp-includes/post.php
r54566 r64183 4061 4061 do_action( 'transition_post_status', $new_status, $old_status, $post ); 4062 4062 4063 /** 4064 * Fires when a post is transitioned from one status to another. 4065 * 4066 * The dynamic portions of the hook name, `$new_status` and `$old status`, 4067 * refer to the old and new post statuses, respectively. 4068 * 4069 * @since 2.3.0 4070 * 4071 * @param WP_Post $post Post object. 4072 */ 4073 do_action( "{$old_status}_to_{$new_status}", $post ); 4074 4075 /** 4076 * Fires when a post is transitioned from one status to another. 4077 * 4078 * The dynamic portions of the hook name, `$new_status` and `$post->post_type`, 4079 * refer to the new post status and post type, respectively. 4080 * 4081 * Please note: When this action is hooked using a particular post status (like 4082 * 'publish', as `publish_{$post->post_type}`), it will fire both when a post is 4083 * first transitioned to that status from something else, as well as upon 4084 * subsequent post updates (old and new status are both the same). 4085 * 4086 * Therefore, if you are looking to only fire a callback when a post is first 4087 * transitioned to a status, use the {@see 'transition_post_status'} hook instead. 4088 * 4089 * @since 2.3.0 4090 * 4091 * @param int $post_id Post ID. 4092 * @param WP_Post $post Post object. 4093 */ 4094 do_action( "{$new_status}_{$post->post_type}", $post->ID, $post ); 4063 $new_status_object = get_post_status_object( $new_status ); 4064 $old_status_valid = get_post_status_object( $old_status ) || 'new' === $old_status; 4065 $post_type_object = get_post_type_object( $post->post_type ); 4066 4067 if ( $new_status_object && $old_status_valid ) { 4068 /** 4069 * Fires when a post is transitioned from one status to another. 4070 * 4071 * The dynamic portions of the hook name, `$new_status` and `$old status`, 4072 * refer to the old and new post statuses, respectively. 4073 * 4074 * @since 2.3.0 4075 * 4076 * @param WP_Post $post Post object. 4077 */ 4078 do_action( "{$old_status}_to_{$new_status}", $post ); 4079 } 4080 4081 if ( $new_status_object && $post_type_object ) { 4082 /** 4083 * Fires when a post is transitioned from one status to another. 4084 * 4085 * The dynamic portions of the hook name, `$new_status` and `$post->post_type`, 4086 * refer to the new post status and post type, respectively. 4087 * 4088 * Please note: When this action is hooked using a particular post status (like 4089 * 'publish', as `publish_{$post->post_type}`), it will fire both when a post is 4090 * first transitioned to that status from something else, as well as upon 4091 * subsequent post updates (old and new status are both the same). 4092 * 4093 * Therefore, if you are looking to only fire a callback when a post is first 4094 * transitioned to a status, use the {@see 'transition_post_status'} hook instead. 4095 * 4096 * @since 2.3.0 4097 * 4098 * @param int $post_id Post ID. 4099 * @param WP_Post $post Post object. 4100 */ 4101 do_action( "{$new_status}_{$post->post_type}", $post->ID, $post ); 4102 } 4095 4103 } 4096 4104 -
branches/4.7/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r60839 r64183 549 549 } 550 550 551 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts) ) {551 if ( ! empty( $request['sticky'] ) && ( ! current_user_can( $post_type->cap->edit_others_posts ) || ! current_user_can( $post_type->cap->publish_posts ) ) ) { 552 552 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 553 553 } … … 693 693 } 694 694 695 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts) ) {695 if ( isset( $request['sticky'] ) && is_sticky( $post->ID ) !== (bool) $request['sticky'] && ( ! current_user_can( $post_type->cap->edit_others_posts ) || ! current_user_can( $post_type->cap->publish_posts ) ) ) { 696 696 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 697 697 }
Note:
See TracChangeset
for help on using the changeset viewer.