Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Extend "Homepage displays" dropdown in admin panel
- */
- function add_pages_to_dropdown( $pages, $r ) {
- if ( ! isset( $r['name'] ) ) {
- return $pages;
- }
- if ( 'page_on_front' === $r['name'] ) {
- $args = array(
- 'post_type' => 'arts_portfolio_item',
- 'posts_per_page' => -1,
- );
- $portfolios = get_posts( $args );
- $pages = array_merge( $pages, $portfolios );
- }
- return $pages;
- }
- add_filter( 'get_pages', 'add_pages_to_dropdown', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement