mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-18 05:53:23 +09:00
Move page choices
This commit is contained in:
@@ -159,25 +159,4 @@ class Display_Featured_Image_Genesis_Author_Widget extends WP_Widget {
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the pages on the site.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_pages() {
|
||||
$page_ids = get_pages( array(
|
||||
'post_type' => 'page',
|
||||
) );
|
||||
$pages = array();
|
||||
if ( $page_ids ) {
|
||||
$pages[] = __( 'None', 'display-featured-image-genesis' );
|
||||
foreach ( $page_ids as $id ) {
|
||||
$title = empty( $id->post_title ) ? '#' . $id->ID . __( ' (no title)', 'sixtenpress-featured-content' ) : $id->post_title;
|
||||
$pages[ $id->ID ] = $title;
|
||||
}
|
||||
}
|
||||
|
||||
return $pages;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
<?php
|
||||
|
||||
$page_ids = get_pages(
|
||||
array(
|
||||
'post_type' => 'page',
|
||||
)
|
||||
);
|
||||
$page_choices = array(
|
||||
'' => __( 'None', 'display-featured-image-genesis' ),
|
||||
);
|
||||
if ( $page_ids ) {
|
||||
foreach ( $page_ids as $page_id ) {
|
||||
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
$title = empty( $page_id->post_title ) ? '#' . $page_id->ID . __( ' (no title)', 'sixtenpress-featured-content' ) : $page_id->post_title;
|
||||
$page_choices[ $page_id->ID ] = $title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Define author specific archive fields.
|
||||
*/
|
||||
@@ -9,7 +25,7 @@ return array(
|
||||
'args' => array(
|
||||
'id' => 'page',
|
||||
'label' => __( 'Choose your extended "About Me" page from the list below. This will be the page linked to at the end of the author description.', 'display-featured-image-genesis' ),
|
||||
'choices' => $this->get_pages(),
|
||||
'choices' => $page_choices,
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user