0, 'label' => '--choose--' ); $arg = array('posts_per_page' => -1); $accesspress_mag_posts = get_posts($arg); foreach ($accesspress_mag_posts as $accesspress_mag_post) : $accesspress_mag_postlist[$accesspress_mag_post->ID] = array( 'value' => $accesspress_mag_post->ID, 'label' => $accesspress_mag_post->post_title ); endforeach; extract($widget_field); switch ($accesspress_mag_widgets_field_type) { // Standard text field case 'text' : ?>




/>

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





get_field_id($accesspress_mag_widgets_name); $class = ''; $int = ''; $value = $athm_field_value; $name = $instance->get_field_name($accesspress_mag_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-mag') . '

'; } $output .= '
' . "\n"; if ($value != '') { $remove = 'Remove'; $attachment_id = accesspress_get_attachment_id_from_url($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 'icon' : add_thickbox(); ?>



'; } return strip_tags($new_field_value, $accesspress_mag_widgets_allowed_tags); // No allowed tags for all other fields } elseif ($accesspress_mag_widgets_field_type == 'iframe_textarea') { // Check if field array specifed allowed tags if (!isset($accesspress_mag_widgets_allowed_tags)) { // If not, fallback to default tags $accesspress_mag_widgets_allowed_tags = '