diff --git a/src/wp-admin/includes/options.php b/src/wp-admin/includes/options.php index 5742e3ccc1ccc..e452f8bad1cd0 100644 --- a/src/wp-admin/includes/options.php +++ b/src/wp-admin/includes/options.php @@ -115,13 +115,13 @@ function options_reading_add_js() { 'blog_charset' ) ); } +/** + * this fillter overrides which post type are show in the dropdown + * + * @uses get_post_types + * + * @param array $args + * @return $args + * + */ +$post_types_allowed_on_home_page = apply_filters( 'post_types_allowed_on_home_page', array_keys( get_post_types( array( 'show_in_home_page_list' => true ) ) ) ); +$args = array( + 'post_type' => $post_types_allowed_on_home_page, + 'post_status' => 'publish', + 'fields' => 'ids' +); +$allowed_pages = new WP_Query( $args ); ?>
- /> - +labels->name ) ); + ?> \n"; + $output .= sprintf( 'A static page (select below)', selected( -1, strtolower( get_option( 'show_on_front' ) ), false ) ) ; + foreach ( $allowed_archives_on_home_page as $post_type ){ + $post_type = ( 'posts' === $post_type ) ? 'post' : $post_type; + $output .= sprintf( '%s', + $post_type, + selected( $post_type, strtolower( get_option( 'show_on_front' ) ),false ), + sprintf( __( 'Your latest %s' ), get_post_type_object( $post_type )->labels->name ) + ) ; + } + $output .= "\n"; + + echo $output; + } + ?>
%s', + 'edit.php?post_type=' . $type, ucfirst( $type ) ); + } + printf( + /* translators: %s: URL to Pages screen. */ + __( 'No selectable pages found! Add/Publish at least one of these content types %s' ), + implode( ', ', $content_type_links ) + ); + ?> +
- /> + static page (select below)' ), - 'edit.php?post_type=page' - ); +// printf( +// /* translators: %s: URL to Pages screen. */ +// __( 'A static page (select below)' ), +// 'edit.php?post_type=page' +// ); ?>