Created
January 5, 2015 18:14
-
-
Save fastlinemedia/18b2b85686ee8aa37540 to your computer and use it in GitHub Desktop.
WordPress Customizer Export/Import Install Control
This file contains 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 | |
/** | |
* @class Export_Import_Install_Control | |
*/ | |
final class Export_Import_Install_Control extends WP_Customize_Control { | |
/** | |
* @method render_content | |
* @protected | |
*/ | |
protected function render_content() | |
{ | |
$plugin = 'customizer-export-import'; | |
$nonce = wp_create_nonce( 'install-plugin_' . $plugin ); | |
$url = admin_url( 'update.php?action=install-plugin&plugin=' . $plugin . '&_wpnonce=' . $nonce ); | |
echo '<p>' . __( 'Please install and activate the "Customizer Export/Import" plugin to proceed.', 'text-domain' ) . '</p>'; | |
echo '<a class="install-now button" href="' . $url . '">' . __( 'Install & Activate', 'text-domain' ) . '</a>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment