' . "\n"; if ( $value == '' ) { $output .= '' . "\n"; } else { $output .= '' . "\n"; } if ( $_desc != '' ) { $output .= '' . $_desc . '' . "\n"; } $output .= '
' . "\n"; if ( $value != '' ) { $remove = 'Remove'; $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', 'optionsframework' ); $output .= '
'.$title.'
'; } } $output .= '
' . "\n"; return $output; } endif; /** * Enqueue scripts for file uploader */ if ( ! function_exists( 'optionsframework_media_scripts' ) ) : function optionsframework_media_scripts(){ wp_enqueue_media(); wp_register_script( 'of-media-uploader', OPTIONS_FRAMEWORK_DIRECTORY .'js/media-uploader.js', array( 'jquery' ) ); wp_enqueue_script( 'of-media-uploader' ); wp_localize_script( 'of-media-uploader', 'optionsframework_l10n', array( 'upload' => __( 'Upload', 'options_framework_theme' ), 'remove' => __( 'Remove', 'options_framework_theme' ) ) ); } endif;