Skip to content

Holiday Snow: remove settings from Admin Page when the tool isn't loaded #6065

@jeherve

Description

@jeherve

Steps to reproduce the issue

  1. Add the following to a functionality plugin on your site:
/**
 * Stop Holiday Snow from loading.
 *
 * @param array $tools Array of theme tools available in Jetpack.
 */
function jeherve_rm_holiday_snow_tool( $tools ) {
        $index = array_search( 'holiday-snow.php', $tools );
        if ( false != $index ) {
                unset( $tools[ $index ] );
        }

        return $tools;
}
add_filter( 'jetpack_tools_to_include', 'jeherve_rm_holiday_snow_tool' );
  1. The Holiday Snow file isn't loaded anymore on your site.
  2. Go to Jetpack > Settings > Appearance.
  3. The Holiday Snow card still appears, although you can't turn it on.

{"code":"some_updated","message":"Invalid option: false.","data":{"status":400}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Admin PageReact-powered dashboard under the Jetpack menuBugWhen a feature is broken and / or not performing as intended[Feature] Theme Tools[Pri] Low

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions