mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-16 13:03:21 +09:00
Add fallback setting for custom content types
This commit is contained in:
@@ -324,6 +324,15 @@ class Display_Featured_Image_Genesis_Settings extends Display_Featured_Image_Gen
|
||||
$this->setting['post_type'][ $post_type ] = $id = '';
|
||||
}
|
||||
|
||||
if ( is_object( $args['post_type'] ) ) {
|
||||
$fallback_args = array(
|
||||
'setting' => "fallback][{$post_type}",
|
||||
'label' => sprintf( __( 'Always use a fallback image for %s.', 'display-featured-image-genesis' ), esc_attr( $args['post_type']->label ) ),
|
||||
'setting_name' => 'fallback',
|
||||
'name' => $post_type,
|
||||
);
|
||||
$this->do_checkbox( $fallback_args );
|
||||
}
|
||||
$id = $this->setting['post_type'][ $post_type ];
|
||||
$name = 'displayfeaturedimagegenesis[post_type][' . esc_attr( $post_type ) . ']';
|
||||
if ( $id ) {
|
||||
@@ -393,6 +402,7 @@ class Display_Featured_Image_Genesis_Settings extends Display_Featured_Image_Gen
|
||||
|
||||
// sanitize
|
||||
$new_value['post_type'][ $object->name ] = $this->validate_image( $new_value['post_type'][ $object->name ], $old_value, $label, $size_to_check );
|
||||
$new_value['fallback'][ $object->name ] = $this->one_zero( $new_value['fallback'][ $object->name ] );
|
||||
}
|
||||
|
||||
return $new_value;
|
||||
|
||||
Reference in New Issue
Block a user