print_customizer_upsell(); if ( isset( $this->description ) ) { echo '' . $this->description . ''; } } /** * Customizer deeplinks HTML * * @return string HTML to use in the customizer panel */ private function print_customizer_upsell() { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $customizer_content = ''; // Get Plugins $plugins = get_plugins(); if ( ! isset( $plugins['elementor/elementor.php'] ) ) { $customizer_content .= $this->get_customizer_upsell_html( __( 'Install Elementor', 'amprogramacion' ), __( 'Create a cross-site Header and Footer using Elementor & Hello theme', 'amprogramacion' ), wp_nonce_url( add_query_arg( [ 'action' => 'install-plugin', 'plugin' => 'elementor', ], admin_url( 'update.php' ) ), 'install-plugin_elementor' ), __( 'Install & Activate', 'amprogramacion' ), get_template_directory_uri() . '/assets/images/go-pro.svg' ); } elseif ( ! defined( 'ELEMENTOR_VERSION' ) ) { $customizer_content .= $this->get_customizer_upsell_html( __( 'Activate Elementor', 'amprogramacion' ), __( 'Create a cross-site Header and Footer using Elementor & Hello theme', 'amprogramacion' ), wp_nonce_url( 'plugins.php?action=activate&plugin=elementor/elementor.php', 'activate-plugin_elementor/elementor.php' ), __( 'Activate Elementor', 'amprogramacion' ), get_template_directory_uri() . '/assets/images/go-pro.svg' ); } elseif ( defined( 'ELEMENTOR_VERSION' ) && version_compare( ELEMENTOR_VERSION, '3.0.12', '<' ) ) { $customizer_content .= $this->get_customizer_upsell_html( __( 'Update Elementor', 'amprogramacion' ), __( 'You need Elementor version 3.1.0 or above to create a cross-site Header and Footer.', 'amprogramacion' ), wp_nonce_url( 'update-core.php' ), __( 'Update Elementor', 'amprogramacion' ), get_template_directory_uri() . '/assets/images/go-pro.svg' ); } else { $customizer_content .= $this->get_customizer_upsell_html( __( 'Set Your Header & Footer', 'amprogramacion' ), __( 'Create cross-site Header and Footer using Elementor & Hello theme', 'amprogramacion' ), wp_nonce_url( 'post.php?post=' . get_option( 'elementor_active_kit' ) . '&action=elementor' ), __( 'Start Here', 'amprogramacion' ), get_template_directory_uri() . '/assets/images/go-pro.svg' ); } echo $customizer_content; } private function get_customizer_upsell_html( $title, $text, $url, $button_text, $image ) { return sprintf( ' ', $title, $text, $url, $button_text, $image ); } }