'athemes_clients_widget', 'description' => __( 'Display your clients list.', 'talon') ); parent::__construct(false, $name = __('Talon: Clients', 'talon'), $widget_ops); $this->alt_option_name = 'athemes_clients_widget'; } function form($instance) { $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : -1; $category = isset( $instance['category'] ) ? esc_attr( $instance['category'] ) : ''; $see_all = isset( $instance['see_all'] ) ? esc_url( $instance['see_all'] ) : ''; $see_all_text = isset( $instance['see_all_text'] ) ? esc_html( $instance['see_all_text'] ) : ''; $newtab = isset( $instance['newtab'] ) ? (bool) $instance['newtab'] : false; ?>

id="get_field_id( 'newtab' ); ?>" name="get_field_name( 'newtab' ); ?>" />

id; } $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : ''; $see_all = isset( $instance['see_all'] ) ? esc_url($instance['see_all']) : ''; $see_all_text = isset( $instance['see_all_text'] ) ? esc_html($instance['see_all_text']) : ''; $number = ( ! empty( $instance['number'] ) ) ? intval( $instance['number'] ) : -1; if ( ! $number ) { $number = -1; } $category = isset( $instance['category'] ) ? esc_attr($instance['category']) : ''; $newtab = isset( $instance['newtab'] ) ? $instance['newtab'] : false; if ( $newtab ) { $target = "_blank"; } else { $target = "_self"; } $clients = new WP_Query( array( 'no_found_rows' => true, 'post_status' => 'publish', 'post_type' => 'clients', 'posts_per_page' => $number, 'category_name' => $category ) ); echo $args['before_widget']; if ($clients->have_posts()) : ?> '; ?> have_posts() ) : $clients->the_post(); ?> ' . sprintf( _x('Info: you have not created any clients. Make sure you have installed the %1$s plugin and then create some clients %2$s', 'no posts info', 'talon'), 'aThemes Toolbox', '' . __('here', 'talon') . '' ) . ''; endif; echo $args['after_widget']; } }