[wp-trac] [WordPress Trac] #19958: Allow custom post types as "home" and get_posts() to return results for more than one post type

WordPress Trac noreply at wordpress.org
Sat Jan 31 15:59:31 UTC 2026


#19958: Allow custom post types as "home" and get_posts() to return results for
more than one post type
-------------------------------------------------+-------------------------
 Reporter:  sooskriszta                          |       Owner:  pbearne
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Administration                       |     Version:  3.3.1
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots changes-   |     Focuses:
  requested needs-unit-tests                     |  accessibility
-------------------------------------------------+-------------------------
Changes (by huzaifaalmesbah):

 * keywords:
     has-patch has-screenshots changes-requested needs-unit-tests needs-
     testing
     => has-patch has-screenshots changes-requested needs-unit-tests


Comment:

 == Patch Testing Report

 Patch Tested: https://github.com/WordPress/wordpress-develop/pull/10798

 === Environment
 - WordPress: 7.0-alpha-61215-src
 - PHP: 8.2.30
 - Server: nginx/1.29.4
 - Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
 - Browser: Chrome 143.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.4
 - MU Plugins: None activated
 - Plugins:
   * Classic Widgets 0.3
   * CPT Homepage Test Helper 1.0
   * Test Reports 1.2.1

 === Steps taken
 1. Added helper plugin to create Books CPT:

    {{{
    add_action('init', function () {
        register_post_type('book', [
            'label' => 'Books',
            'public' => true,
            'has_archive' => true,
            'hierarchical' => true,
            'show_in_home_page_list' => true,
        ]);
    });
    }}}

 2. Activated plugin
 3. Created 3–4 Book posts
 4. Checked Settings → Reading

    BEFORE patch:
    * CPT not visible in homepage dropdown (expected)

 5. Apply patch files
 6. Refreshed admin
 7. Checked Settings → Reading again
 8. Selected Books as homepage and saved
 9. Visited site root (/)
 10. ❌ Patch only partially works and introduces regressions.

 === Expected result
 - All CPT selectable as homepage


 === Observed:
 - ✅ Books CPT appears in dropdown

 BUT:
 ❌ Pages list not displayed as Homepage
 ❌ Page dropdown missing
 ❌ Dropdown shows post slug ("sample-book-3") instead of title ("Sample
 Book 3")
 ❌ When i go to front page redirect to `https://wp-develop.test/book
 /sample-book-3/`



 [[Image(https://i.ibb.co/ML2sGV0/Huzaifa-20260131213735.png)]]
 [[Image(https://i.ibb.co/zWxV12mG/Huzaifa-20260131213748.png)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/19958#comment:60>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list