WC_Admin_Addons::output() public WC 1.0
Handles output of the addons page in admin.
{} Это метод класса: WC_Admin_Addons{}
Хуки из метода
Возвращает
Null. Ничего.
Использование
$result = WC_Admin_Addons::output();
Код WC_Admin_Addons::output() WC Admin Addons::output WC 5.0.0
public static function output() {
$section = isset( $_GET['section'] ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : '_featured';
$search = isset( $_GET['search'] ) ? sanitize_text_field( wp_unslash( $_GET['search'] ) ) : '';
if ( isset( $_GET['section'] ) && 'helper' === $_GET['section'] ) {
do_action( 'woocommerce_helper_output' );
return;
}
if ( isset( $_GET['install-addon'] ) ) {
switch ( $_GET['install-addon'] ) {
case 'woocommerce-services':
self::install_woocommerce_services_addon();
break;
case 'woocommerce-payments':
self::install_woocommerce_payments_addon();
break;
default:
// Do nothing.
break;
}
}
$sections = self::get_sections();
$theme = wp_get_theme();
$current_section = isset( $_GET['section'] ) ? $section : '_featured';
$addons = array();
if ( '_featured' !== $current_section ) {
$category = $section ? $section : null;
$term = $search ? $search : null;
$country = WC()->countries->get_base_country();
$addons = self::get_extension_data( $category, $term, $country );
}
/**
* Addon page view.
*
* @uses $addons
* @uses $sections
* @uses $theme
* @uses $current_section
*/
include_once dirname( __FILE__ ) . '/views/html-admin-page-addons.php';
}