__( '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; }