diff --git a/includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php b/includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php index 409998c..f6a86cb 100644 --- a/includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php +++ b/includes/widgets/displayfeaturedimagegenesis-cpt-archive-widget.php @@ -30,7 +30,7 @@ class Display_Featured_Image_Genesis_Widget_CPT extends WP_Widget { * * @since 2.0.0 */ - function __construct() { + public function __construct() { $this->defaults = array( 'title' => '', @@ -67,7 +67,7 @@ class Display_Featured_Image_Genesis_Widget_CPT extends WP_Widget { * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget */ - function widget( $args, $instance ) { + public function widget( $args, $instance ) { // Merge with defaults $instance = wp_parse_args( (array) $instance, $this->defaults ); @@ -191,94 +191,106 @@ class Display_Featured_Image_Genesis_Widget_CPT extends WP_Widget { * * @param array $instance Current settings */ - function form( $instance ) { + public function form( $instance ) { //* Merge with defaults $instance = wp_parse_args( (array) $instance, $this->defaults ); + $form = new DisplayFeaturedImageGenesisWidgets( $this, $instance ); - ?> -
- - -
+ $form->do_text( $instance, array( + 'id' => 'title', + 'label' => __( 'Title:', 'display-featured-image-genesis' ), + 'class' => 'widefat', + ) ); - '; } + /** + * @return mixed + */ + protected function get_post_types() { + $args = array( + 'public' => true, + '_builtin' => false, + 'has_archive' => true, + ); + $output = 'objects'; + $post_types = get_post_types( $args, $output ); + + $options['post'] = __( 'Posts', 'display-featured-image-genesis' ); + foreach ( $post_types as $post_type ) { + $options[ $post_type->name ] = $post_type->label; + } + + return $options; + } }