'abaya_about_with_image', 'description' => __('This allows for an image and a simple about text.', 'abaya'));
$this->__construct('abaya_about_with_image', __('Abaya: About With Image', 'abaya'), $widget_ops);
$this->alt_option_name = 'abaya_about_with_image';
}
public function widget($args, $instance){
extract( $args );
if(!empty($instance['more_about_me_link'])) {$more_about_me_link =''.__('MORE ABOUT ME','abaya').' ';}
?>
flush_widget_cache();
return $instance;
}
function flush_widget_cache() {
wp_cache_delete('abaya_about_with_image', 'widget');
}
public function form($instance){
$image_uri = isset($instance['image_uri']) ? esc_attr($instance['image_uri']) : '';
$more_about_me_link = isset($instance['more_about_me_link']) ? esc_attr($instance['more_about_me_link']) : '';
?>
'abaya_front_page_product_widget',
'description' => esc_html__( 'This shows the most recent product on your site with a thumbnail', 'abaya')
);
$control_ops = array(
'width' => 200,
'height' => 250
);
parent::__construct( false, $name = esc_html__('Abaya: Front Page Product With Images', 'abaya' ), $widget_ops, $control_ops);
}
function widget($args, $instance) {
$cache = wp_cache_get('abaya_front_page_product_widget', 'widget');
if ( !is_array($cache) )
$cache = array();
if ( ! isset( $args['widget_id'] ) )
$args['widget_id'] = $this->id;
if ( isset( $cache[ $args['widget_id'] ] ) ) {
echo $cache[ $args['widget_id'] ];
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Featured Product', 'abaya') : $instance['title'], $instance, $this->id_base);
if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
$number = 5;
$recent_posts = new WP_Query( apply_filters('widget_posts_args',array('post_type'=>'product','posts_per_page' => $number, 'product_cat' => $instance['thecate'], 'no_found_rows' => true, 'post_status' => 'publish','ignore_sticky_posts' => true ) ) );
if ($recent_posts->have_posts()) :
?>
'; ?>
have_posts()) : $recent_posts->the_post(); ?>