WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 3 months ago

#25267 new defect (bug)

PHP notices in register_post_type()

Reported by: Looimaster Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.6
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Code: http://pastebin.com/P4Ac7seu

What I get when entering:
1) http://localhost/portfolio_category/motion/ - nothing found (content-none.php)
2) http://localhost/portfolio_category/motion/?post_type=portfolio - found a few posts but there is also NOTICE: UNDEFINED PROPERTY: STDCLASS::$LABELS IN C:\WAMP\WWW\WP-INCLUDES\GENERAL-TEMPLATE.PHP ON LINE 700 twice
3) http://localhost/?portfolio_category=motion&post_type=portfolio - found a few posts but there is also NOTICE: UNDEFINED PROPERTY: STDCLASS::$LABELS IN C:\WAMP\WWW\WP-INCLUDES\GENERAL-TEMPLATE.PHP ON LINE 700 twice
4) http://localhost/?portfolio_category=motion - nothing found (content-none.php)
5) http://localhost/portfolio-items/ - works fine

Besides PHP notice I can't access single portfolio_category archives unless I add ?post_type=portfolio to the URL. Should it be this way?

Testing on Twenty Thirteen.

Change History (2)

comment:1 nofearinc7 months ago

Can't reproduce the notice here, I guess it's being caused by other custom code/plugins.

For the "nothing found" section - change your 'exclude_from_search' => true, to false if you want a proper listing.

comment:2 nacin3 months ago

  • Component changed from General to Post Types
Note: See TracTickets for help on using tickets.