[wp-trac] [WordPress Trac] #22373: Don't show post_type

WordPress Trac noreply at wordpress.org
Tue Nov 6 21:27:51 UTC 2012


#22373: Don't show post_type
--------------------------+----------------------
 Reporter:  seravifer     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Post Types    |     Version:  3.4.2
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+----------------------
Changes (by SergeyBiryukov):

 * status:  new => closed
 * severity:  critical => normal
 * milestone:  Awaiting Review =>
 * keywords:  needs-patch =>
 * resolution:   => invalid


Old description:

> When i put this code in the file "function.php"
>
> <code>add_filter('init', create_function('$a', 'global $wp_rewrite;
> $wp_rewrite->author_base = "user"; $wp_rewrite->flush_rules();'));</code>
>
> The post_type "articulos" when I go to see, it show a error "Error 404"
> but if it can edit.
>
> After removing the code not shown.

New description:

 When i put this code in the file "function.php"
 {{{
 add_filter('init', create_function('$a', 'global $wp_rewrite;
 $wp_rewrite->author_base = "user"; $wp_rewrite->flush_rules();'));
 }}}

 The post_type "articulos" when I go to see, it show a error "Error 404"
 but if it can edit.

 After removing the code not shown.

--

Comment:

 `$wp_rewrite->flush_rules()` call is only needed once after a new custom
 post type is added (as described in the Codex articles on
 [http://codex.wordpress.org/Rewrite_API/flush_rules flush_rules] and
 [http://codex.wordpress.org/Function_Reference/WP_Rewrite#Examples
 WP_Rewrite]), not on each page load.


 There's a plugin to change the author base properly: [[BR]]
 http://wordpress.org/extend/plugins/edit-author-slug/

 For the 404 error troubleshooting, please try the support forums:
 http://wordpress.org/support/

 Similar: #20370

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22373#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list