Both the header and background image features setup some globals in order to work, unsetting those globals seems to have some effect, and at the least removes them from the administration side.
add_action('after_setup_theme', 'remove_theme_features', 11 );
function remove_theme_features() {
$GLOBALS['custom_background'] = 'kill_theme_features';
$GLOBALS['custom_image_header'] = 'kill_theme_features';
}
class kill_theme_features {
function init() { return false; }
}
There’s expectations for a class name to be provided as a callback for both of these features, and both expect the given class to have an init method. The solution was to create a dummy class that does nothing and update the globals, which effectively kills off the theme background and header pages in the admin area.
Hope that helps..
Related Posts:
- How to override parent functions in child themes?
- Adding a second email address to a completed order in WooCommerce [closed]
- How to override a function when isn’t at functions.php
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- How to override filter in child theme?
- overwrite code snippet from parent to child theme
- Solution dealing with Child Theme / Parent theme functions
- How to override this theme function in child theme
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove_action on after_setup_theme not working from child theme
- Child theme – Overriding ‘require_once’ in functions.php
- Include files in child theme functions file
- Redeclare a function in a child theme
- Child theme functions.php do I use php open and close tags?
- Declaring an instance of class included in parent theme from child theme functions.php
- One Child Functions.php for Multiple Child Themes
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- How to override functions.php in child theme?
- How to prevent deleting of comments when deleting a post
- Overriding core functions in child theme
- Convert hyphen to underscore in permalinks
- Override parent theme function that is not hooked or in the functions.php file
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- I created a child theme and it doesn’t work for some of the css files
- add sidebar area to header of child theme
- Unregister Nav Menu with fallback?
- Child Theme Not Overriding Parent Theme
- Changes to functions.php not working
- Overriding methods in a child theme
- How to override enqueued styles using a child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Customized wp_new_user_notification
- change default option in wp_dropdown_categories
- What is the criteria for pluggable functions?
- Using the child theme functions.php to change the customizer.php on parent theme
- Child theme functions.php not executing
- How to store / access files in child theme folder
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Overwrite Parent Theme add_image_size in Child Theme
- Proper way of using functions in action hook?
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- how to edit functions.php in a child theme
- Best practice when altering a parent theme function inside a child theme?
- How to make child theme inherit parent custom theme options [closed]
- Include files in child themes, declare in functions.php
- How to remove set_post_thumbnail_size() in child themes?
- Avoid loading css from parent theme
- Creating a child theme – functions.php code issue
- Echo tags used to describe the theme
- Overwriting Parent Theme’s Image Sizes
- Child theme within a child theme?
- Problem only while using require_once() within functions.php
- How can I change a function in a parent theme via a child themes functions.php
- Twentyten Child Theme: header images display messed up in admin panel
- Add other social networks to TwentyNineteen_SVG_Icons class in child theme?
- Why is functions.php file in child not initializing and over-writing parent?
- Please Explain the Importing Process of Multiple Stylesheets for Child Themes
- Reuse variable in hook callback
- Automatically include all php files in a child theme directory
- Override the function twentytwelve_scripts_styles in a child theme
- Add custom function to a theme with child theme’s functions.php
- Pagination in relation to archive.php
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- How to load parent theme template parts in child theme
- Running script based on Category
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- How to target post and pages and not all post types in admin?
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Load custom css in functions.php causing library issue
- Not all CSS elements transferring via parent to child?
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Return child theme url
- Got white blank page after copying the functions.php to child theme
- How do I change a parent theme’s function through the child theme?
- How to edit classes in body tag?
- Can’t locate custom image sizes defined by child theme
- Randomizing wp_tag_cloud() in child theme
- Add back in child theme what the parent theme removed with remove_action
- Can’t switch to a child theme using filters template, option_template and option_stylesheet
- Where do I go to edit this area? [closed]
- How to include any template using Shortcode fuction?
- Parent theme styles overriding child theme CSS [closed]
- Set up functions to be overridden without using function_exists() by short-circuiting them?
- Unable to point the child theme directory even using get_stylesheet_directory()
- How to edit/replace Parent functions.php function in Child Theme to add “Walker” class
- Child theme function.php causes fatal error
- get_template_directory_uri() links to child theme not parent
- Is it possible to use add_filter in an included file in the child theme’s functions.php?