Created
October 18, 2023 05:38
-
-
Save srikat/6144828b9d4572ecbf2a470290b596c5 to your computer and use it in GitHub Desktop.
Adding Posts in the Homepage and Posts page dropdowns at Settings > Reading in WP admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'get_pages', function ( $pages, $r ) { | |
if ( function_exists( 'get_current_screen' ) && 'options-reading' === get_current_screen()->id ) { | |
$pages = array_merge( $pages, get_posts( ['post_type' => 'post'] ) ); | |
} | |
return $pages; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://wordpress.stackexchange.com/a/304645