{$message}"; } /** * Check if we need to force update options removal in case a customer clicked on "Check Again" button * in the notification area. */ function maybe_force_update_requests() { if ( wp_doing_ajax() ) { return; } if ( empty( $_GET['et_action'] ) || 'update_account_details' !== $_GET['et_action'] ) { return; } if ( empty( $_GET['et_update_account_details_nonce'] ) || ! wp_verify_nonce( $_GET['et_update_account_details_nonce'], 'et_update_account_details' ) ) { return; } $this->force_update_requests(); } function get_custom_update_notification_message( $update_message ) { $is_valid_api_key_status = empty( $account_api_key_status = get_site_option( 'et_account_api_key_status' ) ) || 'invalid' !== $account_api_key_status; if ( $is_valid_api_key_status && false !== strpos( $update_message, '/wp-json/api/v1/changelog/product_id/' ) ) { return et_get_safe_localization( __( 'The license for this Divi Marketplace product has expired. Please renew the license to continue receiving product updates and support.', 'et-core' ) ); } if ( false !== strpos( $update_message, 'Automatic update is unavailable for this theme' ) ) { return 'expired' === $this->account_status ? et_get_safe_localization( __( 'Your Elegant Themes subscription has expired. You must renew your account to regain access to product updates and support.', 'et-core' ) ) : et_get_safe_localization( __( 'Before you can receive product updates, you must first authenticate your Elegant Themes subscription. To do this, you need to enter both your Elegant Themes Username and your Elegant Themes API Key into the Updates Tab in your theme and plugin settings. To locate your API Key, log in to your Elegant Themes account and navigate to the Account > API Key page. Learn more here. If you still get this message, please make sure that your Username and API Key have been entered correctly', 'et-core' ) ); } return ''; } function replace_theme_update_notification( $themes_array ) { if ( empty( $themes_array ) ) { return $themes_array; } if ( empty( $this->all_et_products_domains['theme'] ) ) { return $themes_array; } foreach ( $themes_array as $id => $theme_data ) { // replace default error message with custom message for ET themes. if ( ! in_array( $id, $this->all_et_products_domains['theme'] ) || false === strpos( $theme_data['update'], 'Automatic update is unavailable for this theme' ) ) { continue; } if ( ! empty( $custom_message = $this->get_custom_update_notification_message( $theme_data['update'] ) ) ) { $themes_array[ $id ]['update'] = sprintf( '
%1$s %2$s
%1$s
%3$s