nationalarchives / tna-child-about-us-research

TNA Child theme for the used for the open access repository
0 stars 1 forks source link

Redundant stuff should be hidden from the admin interface #4

Closed grange85 closed 8 years ago

grange85 commented 8 years ago

Remove unnecessary stuff inherited from the parent theme THIS will apply to all sub sites, so...:

punalsc commented 8 years ago

Online Exhibitions from left hand menu - Removed Education filter tags in page editor - Removed Guidance categories in page editor - Removed

Custom parent taxonomies Guidance category and Education filter tags: Looking for a way to remove the function from the child theme. We can easily remove the default taxonomies.

grange85 commented 8 years ago

OK @punalsc I've figured this out - the issue is that the child theme's functions.php is loaded BEFORE the parent theme - so the taxonomy doesn't exist to remove it because it gets created AFTERWARDS.

The fix is to make it pluggable so in the parent theme:

if ( function_exists( 'guidance_init' ) ) {
    function guidance_init() {
        //add taxonomy here
    }
    add_action('init', 'guidance_init');
}

so that it only loads if there isn't already a guidance_init function, so to override - in the child theme we have

function guidance_init() {
    //empty function
}

Shout if this needs clarification - @netdesignr , @domingobishop - might also be worth being aware of to make functions in the parent theme overridable if necessary.

grange85 commented 8 years ago

This has now been done