[wp-hackers] change display on custom headers screen

Andrew Nacin wp at andrewnacin.com
Sat Nov 27 04:34:26 UTC 2010


On Fri, Nov 26, 2010 at 10:10 PM, Mike Schinkel <mikeschinkel at newclarity.net
> wrote:

> On Nov 26, 2010, at 1:13 AM, Steve Wolfson wrote:
> > I am setting up the Custom Headers admin page as used in the twenty ten
> > theme on another theme.  I need to remove some of the options from the
> Admin
> > screen.  It seems everything on that screen is hard coded in
> > /wp-admin/custom-header.php.   For example, this will be a WP multisite
> > installation.  We want users to choose one of the custom headers that
> will
> > be displayed on the custom header page, and not have the option to upload
> > their own file.  There are no classes or ID's in the code in the areas I
> > need to remove display of.
>
> Hi Steve,
>
> If I understand what you are asking you want to modify the "Header" screen
> in the admin something like this?:
>
> http://mikeschinkel.com/websnaps/skitched-20101126-214332.png
>
> Assuming I understood then yes, you've found that the admin often does not
> have CSS classes to allow you to hide things and there are frequently no
> hooks available to modify what you want to modify. I'm not sure why nobody
> has thought to add CSS classes yet but as for hooks I think it's simply a
> case of hooks are added when someone takes the effort to ask for them and
> supply a patch on trac and, at least with the admin, there haven't been many
> people to do so.  So it is what it is.


In 3.1, you'll be able to do remove_theme_support( 'custom-header-uploads'
);

You could consider extending the Custom_Image_Header class rather than
modifying the admin output. That's incredibly fragile, and it makes kittens
cry for it to be recommended, especially with such detail. With enough
effort, it would also have been possible to A) hide the upload form through
CSS and some PHP, and B) block custom uploads (as hiding the HTML isn't
necessarily enough) with a little PHP.


More information about the wp-hackers mailing list