403 ) ); } edd_delete_purchase( $payment_id ); edd_redirect( admin_url( 'edit.php?post_type=download&page=edd-payment-history&edd-message=payment_deleted' ) ); } } add_action( 'edd_delete_payment', 'edd_trigger_purchase_delete' ); /** * Add-ons Page * * Renders the add-ons page content. * * @since 1.0 * @deprecated 3.1.1 * @return void */ function edd_add_ons_page() { _edd_deprecated_function( __FUNCTION__, '3.1.1' ); // Filter the add-ons tabs. $add_ons_tabs = apply_filters( 'edd_add_ons_tabs', array( 'popular' => __( 'Popular', 'easy-digital-downloads' ), 'new' => __( 'New', 'easy-digital-downloads' ), 'all' => __( 'All', 'easy-digital-downloads' ) ) ); // Active tab. $active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $add_ons_tabs ) ? sanitize_key( $_GET['tab'] ) : 'popular'; // Empty tabs array. $tabs = array(); // Loop through add-ons and make array of tabs. foreach ( $add_ons_tabs as $tab_id => $tab_name ) { // "All" if ( 'all' === $tab_id ) { $tab_url = edd_link_helper( 'https://easydigitaldownloads.com/downloads/', array( 'utm_medium' => 'addons-page', 'utm_content' => 'all-extensions', ) ); // All other tabs besides "All". } else { $tab_url = add_query_arg( array( 'settings-updated' => false, 'tab' => sanitize_key( $tab_id ), ) ); } // Active? $active = ( $active_tab === $tab_id ) ? 'current' : ''; // Count. $count = ( 'all' === $tab_id ) ? '150+' : '29'; // The link. $tab = '
  • '; $tab .= ( 'all' === $tab_id ) ? '' : ''; $tab .= esc_html( $tab_name ); $tab .= ' (' . esc_html( $count ) . ')'; // "All" is an external link, so denote it as such. if ( 'all' === $tab_id ) { $tab .= ''; } $tab .= ''; $tab .= '
  • '; // Set the tab. $tabs[] = $tab; } // Start a buffer. ob_start(); ?>

    'addons-page', 'utm_content' => 'browse-all', ) ); ?>   

    add functionality to your Easy Digital Downloads powered store.', 'easy-digital-downloads' ); ?>

    sanitize_key( $tab ) ), $url ); } // Remote request. $feed = wp_remote_get( esc_url_raw( $url ), array( 'sslverify' => false ) ); // Handle error. if ( empty( $feed ) || is_wp_error( $feed ) ) { $cache = '

    ' . __( 'These extensions could not be retrieved from the server. Please try again later.', 'easy-digital-downloads' ) . '

    '; // Cache the results. } elseif ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) { $cache = wp_remote_retrieve_body( $feed ); set_transient( $trans_key, $cache, HOUR_IN_SECONDS ); } } return $cache; } /** * Create the Extensions submenu page under the "Downloads" menu * * @since 3.0 * * @global $edd_add_ons_page */ function edd_add_extentions_link() { if ( ! current_user_can( 'manage_shop_settings' ) ) { return; } global $submenu, $edd_add_ons_page; $edd_add_ons_page = add_submenu_page( 'edit.php?post_type=download', __( 'EDD Extensions', 'easy-digital-downloads' ), __( 'Extensions', 'easy-digital-downloads' ), 'manage_shop_settings', 'edd-addons', 'edd_add_ons_page' ); $pass_manager = new \EDD\Admin\Pass_Manager(); if ( ! $pass_manager->has_pass() ) { $submenu[ 'edit.php?post_type=download' ][] = array( '' . esc_html__( 'Upgrade to Pro', 'easy-digital-downloads' ) . '', 'manage_shop_settings', edd_link_helper( 'https://easydigitaldownloads.com/lite-upgrade', array( 'utm_medium' => 'admin-menu', 'utm_content' => 'upgrade-to-pro', ) ) ); add_action( 'admin_print_styles', function() { ?>