=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) { require_once GP_PREMIUM_DIR_PATH . 'sites/sites.php'; } require_once GP_PREMIUM_DIR_PATH . 'inc/activation.php'; require_once GP_PREMIUM_DIR_PATH . 'inc/dashboard.php'; } if ( ! function_exists( 'generate_premium_updater' ) ) { add_action( 'admin_init', 'generate_premium_updater', 0 ); /** * Set up the updater **/ function generate_premium_updater() { if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) { include GP_PREMIUM_DIR_PATH . 'library/EDD_SL_Plugin_Updater.php'; } $license_key = get_option( 'gen_premium_license_key' ); $edd_updater = new EDD_SL_Plugin_Updater( 'https://generatepress.com', __FILE__, array( 'version' => GP_PREMIUM_VERSION, 'license' => trim( $license_key ), 'item_name' => 'GP Premium', 'author' => 'Tom Usborne', 'url' => home_url(), 'beta' => apply_filters( 'generate_premium_beta_tester', false ), ) ); } } if ( ! function_exists( 'generate_premium_setup' ) ) { add_action( 'after_setup_theme', 'generate_premium_setup' ); /** * Add useful functions to GP Premium **/ function generate_premium_setup() { // This used to be in the theme but the WP.org review team asked for it to be removed. // Not wanting people to have broken shortcodes in their widgets on update, I added it into premium. add_filter( 'widget_text', 'do_shortcode' ); } } if ( ! function_exists( 'generate_premium_theme_information' ) ) { add_action( 'admin_notices', 'generate_premium_theme_information' ); /** * Checks whether there's a theme update available and lets you know. * Also checks to see if GeneratePress is the active theme. If not, tell them. * * @since 1.2.95 **/ function generate_premium_theme_information() { $theme = wp_get_theme(); if ( 'GeneratePress' === $theme->name || 'generatepress' === $theme->template ) { // Get our information on updates. // @see https://developer.wordpress.org/reference/functions/wp_prepare_themes_for_js/. $updates = array(); if ( current_user_can( 'update_themes' ) ) { $updates_transient = get_site_transient( 'update_themes' ); if ( isset( $updates_transient->response ) ) { $updates = $updates_transient->response; } } $screen = get_current_screen(); // If a GeneratePress update exists, and we're not on the themes page. // No need to tell people an update exists on the themes page, WP does that for us. if ( isset( $updates['generatepress'] ) && 'themes' !== $screen->base ) { printf( '

%1$s %3$s

', esc_html__( 'GeneratePress has an update available.', 'gp-premium' ), esc_url( admin_url( 'themes.php' ) ), esc_html__( 'Update now.', 'gp-premium' ) ); } } else { // GeneratePress isn't the active theme, let them know GP Premium won't work. printf( '

%1$s %2$s

', esc_html__( 'GP Premium requires GeneratePress to be your active theme.', 'gp-premium' ), esc_html__( 'Install now.', 'gp-premium' ) ); } } } add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'generate_add_configure_action_link' ); /** * Show a "Configure" link in the plugin action links. * * @since 1.3 * @param array $links The existing plugin row links. */ function generate_add_configure_action_link( $links ) { $configuration_link = '' . __( 'Configure', 'gp-premium' ) . ''; return array_merge( $links, array( $configuration_link ) ); } add_action( 'admin_init', 'generatepress_deactivate_standalone_addons' ); /** * Deactivate any standalone add-ons if they're active. * * @since 1.3.1 */ function generatepress_deactivate_standalone_addons() { $addons = array( 'generate-backgrounds/generate-backgrounds.php', 'generate-blog/generate-blog.php', 'generate-colors/generate-colors.php', 'generate-copyright/generate-copyright.php', 'generate-disable-elements/generate-disable-elements.php', 'generate-hooks/generate-hooks.php', 'generate-ie/generate-ie.php', 'generate-menu-plus/generate-menu-plus.php', 'generate-page-header/generate-page-header.php', 'generate-secondary-nav/generate-secondary-nav.php', 'generate-sections/generate-sections.php', 'generate-spacing/generate-spacing.php', 'generate-typography/generate-fonts.php', ); deactivate_plugins( $addons ); }