$field ) { if ( $first_field === $name ) { do_action( "apw_form_before_fields_{$fieldset}", $instance, $widget ); } do_action( "apw_form_before_field_{$name}", $instance, $widget ); // output the actual field echo apply_filters( "apw_form_field_{$name}", $field, $instance, $widget ) . "\n"; do_action( "apw_form_after_field_{$name}", $instance, $widget ); if ( $last_field === $name ) { do_action( "apw_form_after_fields_{$fieldset}", $instance, $widget ); } } $fieldset = ob_get_clean(); echo $fieldset; } /** * Build section header for widget form * * @access public * * @since 1.0 * * @param string $fieldset Slug of fieldset. * @param array $title Name of fieldset. * @param array $instance Current settings. * @param object $widget Widget object. */ public static function build_section_header( $fieldset = 'general', $title = 'General Settings', $instance, $widget ) { ob_start(); ?>

__( 'Published Date', 'advanced-posts-widget' ), 'modified' => __( 'Last Modified Date', 'advanced-posts-widget' ), 'title' => __( 'Title', 'advanced-posts-widget' ), 'menu_order' => __( 'Menu Order', 'advanced-posts-widget' ), 'rand' => __( 'Random', 'advanced-posts-widget' ), ); $params = apply_filters( 'apw_allowed_orderby_params', $_orderby ); $params = Advanced_Posts_Widget_Utils::sanitize_select_array( $params ); return $params; } /** * Builds form field: order * * @access public * * @since 1.0 * * @param array $instance Current settings. * @param object $widget Widget object. */ public static function build_field_order( $instance, $widget ) { ob_start(); ?>

$label ) { self::build_term_select( $name, $label, $instance, $widget ); } endif; ?> 0, 'number' => 99 ) ); $args['fields'] = 'all'; // don't allow override $_terms = get_terms( $taxonomy, $args ); if( empty( $_terms )&& 'post_format' === $taxonomy ){ $formats = get_theme_support( 'post-formats' ); if ( is_array( $formats[0] ) ) { sort( $formats[0]); foreach( $formats[0] as $format ) : $_format = new stdClass(); $_format->slug = $format; $_format->taxonomy = 'post_format'; $_format->name = get_post_format_string( $format ); $_terms[] = $_format; endforeach; } } if( empty( $_terms ) || is_wp_error( $_terms ) ) { return; } ?>

/>

drop down for widget form */ public static function build_img_select( $instance, $widget ) { $sizes = Advanced_Posts_Widget_Utils::get_apw_image_sizes( $fields = 'all' ); if( count( $sizes ) ) : ?>




/>




/>


%5$s%6$s' . "\n", $widget->get_field_id( 'date_format' ), // id $widget->get_field_name( 'date_format' ), // name esc_attr( $format ), // value $checked, // checked date_i18n( $format ), // sample text esc_html( $format ) // format string ); } ?>

/>