mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Customizer: Restrict image control uploaders to only allow image file types. see #22149.
git-svn-id: https://develop.svn.wordpress.org/trunk@22492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -402,6 +402,7 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
|
||||
public $type = 'upload';
|
||||
public $removed = '';
|
||||
public $context;
|
||||
public $extensions;
|
||||
|
||||
/**
|
||||
* Enqueue control related scripts/styles.
|
||||
@@ -425,6 +426,9 @@ class WP_Customize_Upload_Control extends WP_Customize_Control {
|
||||
|
||||
if ( $this->context )
|
||||
$this->json['context'] = $this->context;
|
||||
|
||||
if ( $this->extensions )
|
||||
$this->json['extensions'] = $this->extensions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +460,7 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
|
||||
public $type = 'image';
|
||||
public $get_url;
|
||||
public $statuses;
|
||||
public $extensions = 'jpg,jpeg,gif,png';
|
||||
|
||||
protected $tabs = array();
|
||||
|
||||
|
||||
@@ -313,6 +313,9 @@ function wp_default_scripts( &$scripts ) {
|
||||
'cancel' => __( 'Cancel' ),
|
||||
'close' => __( 'Close' ),
|
||||
'cheatin' => __( 'Cheatin’ uh?' ),
|
||||
|
||||
// Used for overriding the file types allowed in plupload.
|
||||
'allowedFiles' => __( 'Allowed Files' ),
|
||||
) );
|
||||
|
||||
$scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'backbone', 'jquery' ), false, 1 );
|
||||
|
||||
Reference in New Issue
Block a user