Ticket #40922: 40922.4.diff
File 40922.4.diff, 2.8 KB (added by , 7 years ago) |
---|
-
src/wp-includes/default-filters.php
391 391 add_action( 'rest_api_init', 'create_initial_rest_routes', 99 ); 392 392 add_action( 'parse_request', 'rest_api_loaded' ); 393 393 394 // Backcompat filter for mapping `customize_changeset` capabilities. 395 add_filter( 'map_meta_cap', 'wp_map_customize_changeset_caps', 0, 4 ); 396 394 397 /** 395 398 * Filters formerly mixed into wp-includes 396 399 */ -
src/wp-includes/post.php
168 168 ), 169 169 'public' => false, 170 170 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 171 'map_meta_cap' => true,171 'map_meta_cap' => false, 172 172 'hierarchical' => false, 173 173 'rewrite' => false, 174 174 'query_var' => false, … … 177 177 'supports' => array( 'title', 'author' ), 178 178 'capability_type' => 'customize_changeset', 179 179 'capabilities' => array( 180 'create_posts' => 'customize', 181 'delete_others_posts' => 'customize', 182 'delete_post' => 'customize', 183 'delete_posts' => 'customize', 184 'delete_private_posts' => 'customize', 185 'delete_published_posts' => 'customize', 186 'edit_others_posts' => 'customize', 187 'edit_post' => 'customize', 188 'edit_posts' => 'customize', 189 'edit_private_posts' => 'customize', 190 'edit_published_posts' => 'do_not_allow', 191 'publish_posts' => 'customize', 180 'delete_others_posts' => 'delete_others_customize_changesets', 181 'delete_posts' => 'delete_customize_changesets', 182 'delete_private_posts' => 'delete_private_customize_changesets', 183 'delete_published_posts' => 'delete_published_customize_changesets', 184 'edit_private_posts' => 'edit_private_customize_changesets', 185 'edit_published_posts' => 'edit_published_customize_changesets', 192 186 'read' => 'read', 193 'read_post' => 'customize',194 'read_private_posts' => 'customize',195 187 ), 196 188 ) ); 197 189 -
src/wp-includes/theme.php
3121 3121 clean_post_cache( $post_id ); 3122 3122 } 3123 3123 } 3124 3125 function wp_map_customize_changeset_caps( $caps, $cap, $user_id, $args ) { 3126 if ( in_array( 3127 $cap, 3128 array( 3129 'delete_customize_changeset', 3130 'edit_customize_changeset', 3131 'read_customize_changeset', 3132 'edit_customize_changesets', 3133 'edit_others_customize_changesets', 3134 'publish_customize_changesets', 3135 'read_private_customize_changesets', 3136 ), 3137 true 3138 ) ) { 3139 $caps = call_user_func_array( 'map_meta_cap', array_merge( array( 'customize', $user_id ), $args ) ); 3140 } 3141 3142 return $caps; 3143 }