.
* We'll apply some CSS in order to move the section to the top
* as well as style the section & the iframe.
*/
class Kirki_Installer_Control extends WP_Customize_Control {
/**
* The control-type.
*
* @access public
* @var string
*/
public $type = 'kirki-installer';
/**
* Renders the control.
*
* @access public
*/
public function render_content() {
?>
'install-plugin',
'plugin' => $plugin_slug,
),
self_admin_url( 'update.php' )
);
$nonce_key = 'install-plugin_' . $plugin_slug;
$plugin_install_url = wp_nonce_url( $plugin_install_url, $nonce_key );
?>
activate it.', 'alpha-store' ), esc_url_raw( admin_url( 'plugins.php' ) ) ); ?>
add_section( 'kirki_installer', array( 'title' => '', 'description' => esc_attr__( 'If you want to take full advantage of the options this theme has to provide, please install the Kirki plugin.', 'alpha-store' ), 'priority' => -10, 'capability' => 'install_plugins', ) ); // Add the setting. This is required by WordPress in order to add our control. $wp_customize->add_setting( 'kirki_installer', array( 'type' => 'theme_mod', 'capability' => 'install_plugins', 'default' => '', 'sanitize_callback' => '__return_true', )); // Add our control. This is required in order to show the section. $wp_customize->add_control( new Kirki_Installer_Control( $wp_customize, 'kirki_installer', array( 'section' => 'kirki_installer', ) ) ); } add_action( 'customize_register', 'kirki_installer_register' ); } }