diff --git a/docs/files/class-kirki-installer-section.php b/docs/files/class-kirki-installer-section.php index a0c924fa5..3a91dc8bc 100644 --- a/docs/files/class-kirki-installer-section.php +++ b/docs/files/class-kirki-installer-section.php @@ -35,6 +35,14 @@ class Kirki_Installer_Section extends WP_Customize_Section { */ public $type = 'kirki_installer'; + /** + * The plugin install URL. + * + * @access private + * @var string + */ + public $plugin_install_url; + /** * Render the section. * @@ -55,15 +63,7 @@ protected function render() { $installed = true; } } - // Get the plugin-installation URL. - $plugin_install_url = add_query_arg( - array( - 'action' => 'install-plugin', - 'plugin' => 'kirki', - ), - self_admin_url( 'update.php' ) - ); - $plugin_install_url = wp_nonce_url( $plugin_install_url, 'install-plugin_kirki' ); + $plugin_install_url = $this->get_plugin_install_url(); $classes = 'cannot-expand accordion-section control-section control-section-themes control-section-' . $this->type; ?>
- + plugin_install_url ) { + // Get the plugin-installation URL. + $this->plugin_install_url = add_query_arg( + array( + 'action' => 'install-plugin', + 'plugin' => 'kirki', + ), + self_admin_url( 'update.php' ) + ); + $this->plugin_install_url = wp_nonce_url( $plugin_install_url, 'install-plugin_kirki' ); + } + return $this->plugin_install_url; + } } }