[wp-trac] [WordPress Trac] #26989: WP_Customize_Upload_Control cannot be extended to only accept .ico files
WordPress Trac
noreply at wordpress.org
Sat Feb 1 23:30:23 UTC 2014
#26989: WP_Customize_Upload_Control cannot be extended to only accept .ico files
-------------------------------------------------+-------------------------
Reporter: ScottSmith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
Component: Options, Meta APIs | Review
Severity: normal | Version: 3.8
Focuses: javascript, administration, | Keywords:
template |
-------------------------------------------------+-------------------------
While adding a theme option for users of my theme to upload favicons (due
to [http://wordpress.org/support/topic/please-allow-standard-ico-favicon-
file this request],) I realized that the WP_Customize_Image_Control class
doesn't accept .ico image uploads. When the image upload dialogue was
selected, .ico files would not be a selectable option, so I tried
extending the WP_Customize_Image_Control class which was unsuccessful and
then tried extending the WP_Customize_Upload_Control class in similar
fashion to the WP_Customize_Image_Control class. Unfortunately, only png
files are allowed and ice files are not. I've added both the mime type and
file extension for the .ico file and neither allows the image to be
selected.
This is what I ended up with:
{{{
class Decode_Customize_Favicon_Image_Control extends
WP_Customize_Upload_Control {
public $extensions = array( 'ico', 'png', 'image/x-icon' );
}
}}}
This seems to be due to the fact that the JavaScript responsible for image
uploads in wp-includes/js/plupload/plupload.js doesn't have .ico files in
it's list of file types.
At this point, my abilities end. Thanks for hearing me out.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26989>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list