[theme-reviewers] Request for Exemption: Custom backgrounds and Text Domain

Otto otto at ottodestruct.com
Tue Dec 27 08:04:42 UTC 2011


On Mon, Dec 26, 2011 at 8:47 PM, Vicky Arulsingam
<vicky.arulsingam at gmail.com> wrote:
> 1. Custom Background
> The author has a number of other background elements (content area, sidebar,
> footer) and not just the body background and would like to keep them all in
> one page
> Is there any way to integrate other background elements in the Background
> page?

It's possible to change the custom background on a deeper level than
just the basic three callbacks available to you, but it's not
particularly easy without knowing some PHP and object oriented stuff.

The way I'd probably do extensive customization of the custom
background system would be to extend the Custom_Background class to do
what I wanted. You'd have to call the parent class in your own
functions to let it do its thing, then you'd do your additional bits.

To actually hook in your class, you'd have to call
add_custom_background as per usual, then do this code:

add_custom_background(...whatever...);
include file-with-my-custom-background-class.php

And in that file, something like this:
... define your class, then...
remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );
$GLOBALS['custom_background'] = new My_Own_Custom_Background(...whatever...);
add_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );

The trick is that you have to call the add_custom_background first so
that the class gets defined. Then you include your class which extends
it. Then you unhook the old default Custom_Background from the system,
instantiate your class which replaces it, and then add it in to the
proper calls as needed.

Note that he'll probably want to pass a header_callback to the
add_custom_background function, but not the two admin callbacks since
he can just put those into his own class.


> 2. Text Domain
> The theme is a basic version of the author's premium offering and he'd like
> to use the text  domain "swift" instead of the required "swift-basic".

No, as we already have a theme called "Swift" in the directory. We'd
prefer that the theme use both a name and text-domain which is unique
to the directory, which is why we want the name to be reasonably the
same as the textdomain.

http://wordpress.org/extend/themes/swift

-Otto


More information about the theme-reviewers mailing list