Skip to content

Instantly share code, notes, and snippets.

@obiPlabon
Last active November 6, 2017 20:56
Show Gist options
  • Save obiPlabon/59582e1387677936ddb0fad41c792ba2 to your computer and use it in GitHub Desktop.
Save obiPlabon/59582e1387677936ddb0fad41c792ba2 to your computer and use it in GitHub Desktop.
Bypass WordPress theme update notification. বাংলা টিউটোরিয়ালঃ http://obiplabon.im/745/bypass-wordpress-theme-update-notification/
<?php
/**
* Disable theme update notification
*
* Disabled this notification because there is a theme
* in WP theme directory with same name.
* We'll do this based on author name as author won't be same
*
* @param array $theme Installed themes information
* @return array Modified information
*/
function op_disable_theme_update_notification( $theme ) {
$slug = 'theme-slug';
if ( isset( $theme[$slug] ) && $theme[$slug]['author'] == 'Theme Author' ) {
$theme[$slug]['hasUpdate'] = false;
}
return $theme;
}
add_filter( 'wp_prepare_themes_for_js', 'op_disable_theme_update_notification' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment