[wp-trac] [WordPress Trac] #29999: update post overwrites slug if current_user is contributor

WordPress Trac noreply at wordpress.org
Thu Oct 16 08:09:05 UTC 2014


#29999: update post overwrites slug if current_user is contributor
-----------------------------+-----------------------------
 Reporter:  jnhghy           |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  4.0
 Severity:  normal           |   Keywords:
  Focuses:  docs             |
-----------------------------+-----------------------------
 The [http://codex.wordpress.org/Function_Reference/wp_update_post/
 wp_update_post] function calls
 [http://codex.wordpress.org/Function_Reference/wp_insert_post/
 wp_insert_post] which is located in
 [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
 includes/post.php#L3068/ wp-includes/post.php] in posts.php at lines 3168
 - 3171 there is this code:

 {{{
                 // Don't allow contributors to set the post slug for
 pending review posts.
                 if ( 'pending' == $post_status && !current_user_can(
 'publish_posts' ) ) {
                         $post_name = '';
                 }
 }}}

 this will remove post_name if the current user is a contributor without
 any message or notification. This creates an issue because scripts/plugins
 that uses wp_upadate_post usually don't handle this case (the
 documentation doesn't cover this also - I would update the documentation
 but I'm wondering if there's no other solution).

 I don't see the issues that a contributor changing the slug would create
 (a contributor vs an editor) anybody does?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29999>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list