0, 'label' => esc_html__('--choose--','enlighten') ); $arg = array('posts_per_page' => -1); $enlighten_posts = get_posts($arg); foreach ($enlighten_posts as $enlighten_post) : $enlighten_postlist[$enlighten_post->ID] = array( 'value' => $enlighten_post->ID, 'label' => $enlighten_post->post_title ); endforeach; extract($widget_field); switch ($enlighten_widgets_field_type) { // Standard text field case 'text' : ?>



/>

'; foreach ($enlighten_widgets_field_options as $athm_option_name => $athm_option_title) { ?> />





get_field_id($enlighten_widgets_name)); $class = ''; $int = ''; $value = $athm_field_value; $name = esc_attr($instance->get_field_name($enlighten_widgets_name)); if ($value) { $class = ' has-file'; $value = explode('wp-content',$value); $value = content_url().$value[1]; } $output .= '
'; $output .= '
'; $output .= '' . "\n"; if (function_exists('wp_enqueue_media')) { $output .= '' . "\n"; } else { $output .= '

' . esc_attr__('Upgrade your version of WordPress for full media support.', 'enlighten') . '

'; } $output .= '
' . "\n"; if ($value != '') { $remove = ''. esc_attr__('Remove', 'enlighten').''; $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_attr__('View File', 'enlighten'); $output .= ''; } } $output .= '
' . "\n"; echo $output; break; case 'icon' : add_thickbox(); ?>