* @license GPL-2.0+ * @link http://wptheming.com * @copyright 2010-2014 WP Theming */ class Options_Framework_Media_Uploader { /** * Initialize the media uploader class * * @since 1.7.0 */ public function init() { add_action( 'admin_enqueue_scripts', array( $this, 'optionsframework_media_scripts' ) ); } /** * Media Uploader Using the WordPress Media Library. * * Parameters: * * string $_id - A token to identify this field (the name). * string $_value - The value of the field, if present. * string $_desc - An optional description of the field. * */ static function optionsframework_uploader( $_id, $_value, $_desc = '', $_name = '' ) { // Gets the unique option id $options_framework = new Options_Framework; $option_name = $options_framework->get_option_name(); $output = ''; $id = ''; $class = ''; $int = ''; $value = ''; $name = ''; $id = strip_tags( strtolower( $_id ) ); // If a value is passed and we don't have a stored value, use the value that's passed through. if ( $_value != '' && $value == '' ) { $value = $_value; } if ($_name != '') { $name = $_name; } else { $name = $option_name.'['.$id.']'; } if ( $value ) { $class = ' has-file'; } $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.', 'theme-textdomain' ) . '
'; } if ( $_desc != '' ) { $output .= ' ' . "\n"; } $output .= '