Created
January 28, 2019 20:36
-
-
Save mintplugins/c47e1d5e140c3942bcb9f33e58a548fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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