0, 'label' => esc_html__('--choose--','buzstores') ); $arg = array('posts_per_page' => -1); $buzstores_pages = get_pages($arg); foreach($buzstores_pages as $buzstores_page) : $buzstores_pagelist[$buzstores_page->ID] = array( 'value' => $buzstores_page->ID, 'label' => $buzstores_page->post_title ); endforeach; //print_r($widget_field); extract( $widget_field ); switch( $buzstores_widgets_field_type ) { // Standard text field case 'text' : ?>


/>

'; foreach ( $buzstores_widgets_field_options as $athm_option_name => $athm_option_title) { print_r($buzstores_widgets_field_options); if( isset( $athm_field_value[$athm_option_name] ) ) { $athm_field_value[$athm_option_name] = 1; }else{ $athm_field_value[$athm_option_name] = 0; } ?>

/>

'; if (isset($buzzstore_widgets_description)) { ?>




get_field_id($buzstores_widgets_name)); $class = ''; $int = ''; $value = esc_html($athm_field_value); $name = esc_attr($instance->get_field_name($buzstores_widgets_name)); if ($value) { $class = ' has-file'; } $output .= '
'; $output .= '
'; $output .= '' . "\n"; if (function_exists('wp_enqueue_media')) { $output .= '' . "\n"; } else { $output .= '

' . esc_html__('Upgrade your version of WordPress for full media support.', 'buzstores') . '

'; } $output .= '
' . "\n"; if ($value != '') { $remove = ''.esc_html__('Remove','buzstores').''; $attachment_id = attachment_url_to_postid($value); $image_array = wp_get_attachment_image_src($attachment_id, 'medium'); $image = preg_match('/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value); if ($image) { $output .= '' . $remove; } else { $parts = explode("/", $value); for ($i = 0; $i < sizeof($parts); ++$i) { $title = $parts[$i]; } // No output preview if it's not an image. $output .= ''; // Standard generic output if it's not an image. $title = esc_html__('View File', 'buzstores'); $output .= ''; } } $output .= '
' . "\n"; echo $output; break; } } function buzstores_widgets_updated_field_value( $widget_field, $new_field_value ) { extract( $widget_field ); // Allow only integers in number fields if( $buzstores_widgets_field_type == 'number' ) { return absint( $new_field_value ); } elseif ($buzstores_widgets_field_type == 'multicheckboxes') { return wp_kses_post($new_field_value); } elseif( $buzstores_widgets_field_type == 'textarea' ) { if( !isset( $buzstores_widgets_allowed_tags ) ) { $buzstores_widgets_allowed_tags = '

'; } return strip_tags( $new_field_value, $buzstores_widgets_allowed_tags ); } else { return strip_tags( $new_field_value ); } }