Skip to content

Instantly share code, notes, and snippets.

@mintplugins
Created January 28, 2019 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mintplugins/c47e1d5e140c3942bcb9f33e58a548fc to your computer and use it in GitHub Desktop.
Save mintplugins/c47e1d5e140c3942bcb9f33e58a548fc to your computer and use it in GitHub Desktop.
<?php
function simple_theme_updater( $update_themes, $transient_name ) {
// We can use the active theme name, because if this code is running, we know this is the active theme.
$active_theme_slug = get_template();
$theme = json_decode(
json_encode(
array(
'new_version' => 890,
'url' => 'https://myfaketheme.com',
'package' => 'https://myfaketheme.com/my-fake-theme.zip',
)
), true, 3
);
$theme['theme'] = $active_theme_slug;
$update_themes->response[$active_theme_slug] = $theme;
return $update_themes;
}
add_filter( 'pre_set_site_transient_update_themes', 'simple_theme_updater', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment