Update settings fields to use types instead of callbacks

This commit is contained in:
Robin Cornett
2019-05-18 15:31:50 -04:00
parent 8ed9cdb9a1
commit f80d4a65c7
6 changed files with 159 additions and 93 deletions
+8 -9
View File
@@ -2,17 +2,17 @@
$fields = array(
array(
'id' => 'skip',
'title' => __( 'Skip Content Types', 'display-featured-image-genesis' ),
'callback' => 'do_checkbox_array',
'section' => 'cpt_sitewide',
'options' => $this->get_post_types(),
'skip' => true,
'id' => 'skip',
'title' => __( 'Skip Content Types', 'display-featured-image-genesis' ),
'type' => 'checkbox_array',
'section' => 'cpt_sitewide',
'options' => $this->get_post_types(),
'skip' => true,
),
array(
'id' => 'fallback',
'title' => __( 'Prefer Fallback Images', 'display-featured-image-genesis' ),
'callback' => 'do_checkbox_array',
'type' => 'checkbox_array',
'section' => 'cpt_sitewide',
'options' => $this->get_post_types(),
'description' => __( 'Select content types which should always use a fallback image, even if a featured image has been set.', 'display-featured-image-genesis' ),
@@ -21,7 +21,7 @@ $fields = array(
array(
'id' => 'large',
'title' => __( 'Force Large Images', 'display-featured-image-genesis' ),
'callback' => 'do_checkbox_array',
'type' => 'checkbox_array',
'section' => 'cpt_sitewide',
'options' => $this->get_post_types(),
'description' => __( 'Select content types which should always prefer to use the large image size instead of the banner, even if a banner size image is available (singular posts/pages, not archives).', 'display-featured-image-genesis' ),
@@ -38,7 +38,6 @@ foreach ( $post_types as $post_type => $label ) {
$fields[] = array(
'id' => esc_attr( $post_type ),
'title' => esc_attr( $label ),
'callback' => 'set_cpt_image',
'section' => 'cpt',
'type' => 'image',
);