/** * Hijacks themes passed for upgrade checking and remove those from Themify * @param Bool * @param Array $r List of themes * @param String $url URL of upgrade check * @return Array * @since 1.1.8 */ function themify_hide_themes($r, $url) { if (false !== stripos($url, 'api.wordpress.org/themes/update-check')) { $themes = json_decode($r['body']['themes']); $themes_list = themify_get_theme_names(); if (is_array($themes_list)) { foreach ($themes_list as $theme_name) { unset($themes->themes->{$theme_name}); } $r['body']['themes'] = json_encode($themes); } } return $r; }
/** * Hijacks themes passed for upgrade checking and remove those from Themify * @param Bool * @param Array $r List of themes * @param String $url URL of upgrade check * @return Array * @since 1.1.8 */ function themify_hide_themes($r, $url) { if (0 !== strpos($url, 'http://api.wordpress.org/themes/update-check')) { return $r; } $themes = unserialize($r['body']['themes']); $themes_list = themify_get_theme_names(); foreach ($themes_list as $theme_name) { unset($themes[$theme_name]); } unset($themes[get_option('template')]); unset($themes[get_option('stylesheet')]); $r['body']['themes'] = serialize($themes); return $r; }