[wp-trac] [WordPress Trac] #62013: the post_name field is not taken into account

WordPress Trac noreply at wordpress.org
Mon Sep 9 08:46:15 UTC 2024


#62013: the post_name field is not taken into account
-------------------------------+-----------------------------
 Reporter:  yperret            |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  6.6.1
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 it seems that the post_name field is never defined and takes the slug from
 the title.

 After look, the control in wp_insert_post for if the field is defined
 doesn't work.

 Code :
 {{{
         $my_post = array(
             'post_title'    => wp_strip_all_tags("Logout"),
             'post_name '    => "logout-page",
             'post_content'  => "",
             'post_status'   => 'publish',
             'post_type'     => 'page'
         );

         $logout = wp_insert_post( $my_post );
 }}}

 Maybe the problem is located at the line 4281 in post.php

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


More information about the wp-trac mailing list