Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22373 closed defect (bug) (invalid)

Don't show post_type

Reported by: seravifer's profile seravifer Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

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.

Change History (3)

#1 @SergeyBiryukov
12 years ago

  • Description modified (diff)
  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Severity changed from critical to normal
  • Status changed from new to closed

$wp_rewrite->flush_rules() call is only needed once after a new custom post type is added (as described in the Codex articles on flush_rules and WP_Rewrite), not on each page load.

There's a plugin to change the author base properly:

For the 404 error troubleshooting, please try the support forums: ​

Similar: #20370

#2 @seravifer
12 years ago

  • Resolution invalid deleted
  • Severity changed from normal to major
  • Status changed from closed to reopened

But the problem is that the post_type "articulos" show error 404.

#3 @ocean90
12 years ago

  • Resolution set to invalid
  • Severity changed from major to normal
  • Status changed from reopened to closed

Please try the support forums: ​​

Note: See TracTickets for help on using tickets.