| | 164 | function wp_hotfix_350_twentytwelve_update_core_php() { |
| | 165 | if ( ! empty( $_GET['action'] ) ) |
| | 166 | return; |
| | 167 | |
| | 168 | $theme = wp_get_theme('twentytwelve'); |
| | 169 | if ( ! $theme->exists() || ! $theme->errors() ) |
| | 170 | return; |
| | 171 | |
| | 172 | delete_site_transient( 'update_themes' ); |
| | 173 | } |
| | 174 | |
| | 175 | function wp_hotfix_350_twentytwelve_themes_php() { |
| | 176 | $theme = wp_get_theme('twentytwelve'); |
| | 177 | if ( ! $theme->exists() || ! $theme->errors() ) |
| | 178 | return; |
| | 179 | |
| | 180 | // Non-English installs weren't affected. Saves us the need to translate! |
| | 181 | if ( 'en_US' != get_locale() ) |
| | 182 | return; |
| | 183 | |
| | 184 | if ( current_user_can( 'update_themes' ) ) |
| | 185 | add_action( 'admin_notices', 'wp_hotfix_350_twentytwelve_notice' ); |
| | 186 | } |
| | 187 | |
| | 188 | function wp_hotfix_350_twentytwelve_notice() { |
| | 189 | printf( '<div class="error"><p><strong>Looking for Twenty Twelve?</strong> You will need to first update it at <a href="%s">Dashboard → Updates</a>.</p></div>', |
| | 190 | self_admin_url( 'update-core.php' ) ); |
| | 191 | } |
| | 192 | |