0, 'label' => '--choose--' ); $arg = array('posts_per_page' => -1); $accesspress_pro_posts = get_posts($arg); $i = 1; foreach( $accesspress_pro_posts as $accesspress_pro_post ) : $accesspress_pro_postlist[$accesspress_pro_post->ID] = array( 'value' => $accesspress_pro_post->ID, 'label' => $accesspress_pro_post->post_title ); $i++; endforeach; $accesspress_basic_pagelist[0] = array( 'value' => 0, 'label' => '--choose--' ); $accesspress_basic_pages = get_pages($arg); foreach($accesspress_basic_pages as $accesspress_basic_page) : $accesspress_basic_pagelist[$accesspress_basic_page->ID] = array( 'value' => $accesspress_basic_page->ID, 'label' => $accesspress_basic_page->post_title ); endforeach; //print_r($widget_field); extract( $widget_field ); switch( $apbasic_widgets_field_type ) { // Standard text field case 'text' : ?>


/>

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






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

' . __('Upgrade your version of WordPress for full media support.', 'accesspress-basic') . '

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