parent = $parent; $this->instance = $instance; } /** * Get the public registered post types on the site. * * @return mixed */ public 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; } /** * @return array */ public function get_image_size() { $sizes = genesis_get_image_sizes(); $options = array(); foreach ( (array) $sizes as $name => $size ) { $options[ $name ] = sprintf( '%s ( %s x %s )', esc_html( $name ), (int) $size['width'], (int) $size['height'] ); } return $options; } /** * @return array */ public function get_image_alignment() { return array( 'alignnone' => __( 'None', 'display-featured-image-genesis' ), 'alignleft' => __( 'Left', 'display-featured-image-genesis' ), 'alignright' => __( 'Right', 'display-featured-image-genesis' ), 'aligncenter' => __( 'Center', 'display-featured-image-genesis' ), ); } /** * Build boxes with fields. * * @param $boxes * @param string $class */ public function do_boxes( $boxes, $class = '' ) { foreach ( $boxes as $box => $value ) { if ( ! $value ) { continue; } $box_class = ! $class ? 'genesis-widget-column-box' : 'genesis-widget-column-box ' . $class; printf( '