WooCommerce Code Reference

WC_Admin_Addons
in package

WC_Admin_Addons Class.

Table of Contents

add_in_app_purchase_url_params()  : mixed
Add in-app-purchase URL params to link.
build_parameter_string()  : string
Build url parameter string
get_extension_data()  : array
Call API to get extensions
get_featured()  : array
Get featured for the addons screen
get_in_app_purchase_url_params()  : mixed
Returns in-app-purchase URL params.
get_section()  : object|bool
Get section for the addons screen.
get_section_data()  : array
Get section content for the addons screen.
get_sections()  : array
Get sections for the addons screen
install_woocommerce_services_addon()  : mixed
Install WooCommerce Services from Extensions screens.
output()  : mixed
Handles output of the addons page in admin.
output_banner_block()  : mixed
Handles the outputting of a banner block.
output_button()  : mixed
Outputs a button.
output_column()  : mixed
Handles the outputting of a column.
output_column_block()  : mixed
Handles the outputting of a column block.
output_featured_sections()  : mixed
Handles the outputting of featured sections
output_small_dark_block()  : mixed
Handles the outputting of a small dark block.
output_small_light_block()  : mixed
Handles the outputting of a small light block.
output_storefront_button()  : mixed
Handles the outputting of a contextually aware Storefront link (points to child themes if Storefront is already active).
output_wcs_banner_block()  : mixed
Handles the outputting of the WooCommerce Services banner block.
show_extension()  : bool
Should an extension be shown on the featured page.

Methods

add_in_app_purchase_url_params()

Add in-app-purchase URL params to link.

public static add_in_app_purchase_url_params(string $url) : mixed

Adds various url parameters to a url to support a streamlined flow for obtaining and setting up WooCommerce extensons.

Parameters
$url : string

Destination URL.

Return values
mixed

build_parameter_string()

Build url parameter string

public static build_parameter_string(string $category, string $term, string $country) : string
Parameters
$category : string

Addon (sub) category.

$term : string

Search terms.

$country : string

Store country.

Return values
stringurl parameter string

get_extension_data()

Call API to get extensions

public static get_extension_data(string $category, string $term, string $country) : array
Parameters
$category : string

Addon (sub) category.

$term : string

Search terms.

$country : string

Store country.

Return values
arrayof extensions

get_section()

Get section for the addons screen.

public static get_section(string $section_id) : object|bool
Parameters
$section_id : string

Required section ID.

Return values
object|bool

get_section_data()

Get section content for the addons screen.

public static get_section_data(string $section_id) : array
Parameters
$section_id : string

Required section ID.

Return values
array

install_woocommerce_services_addon()

Install WooCommerce Services from Extensions screens.

public static install_woocommerce_services_addon() : mixed
Return values
mixed

output_banner_block()

Handles the outputting of a banner block.

public static output_banner_block(object $block) : mixed
Parameters
$block : object

Banner data.

Return values
mixed

output_button()

Outputs a button.

public static output_button(string $url, string $text, string $style[, string $plugin = '' ]) : mixed
Parameters
$url : string

Destination URL.

$text : string

Button label text.

$style : string

Button style class.

$plugin : string = ''

The plugin the button is promoting.

Return values
mixed

output_column()

Handles the outputting of a column.

public static output_column(object $block) : mixed
Parameters
$block : object

Column data.

Return values
mixed

output_column_block()

Handles the outputting of a column block.

public static output_column_block(object $block) : mixed
Parameters
$block : object

Column block data.

Return values
mixed

Handles the outputting of featured sections

public static output_featured_sections(array $sections) : mixed
Parameters
$sections : array

Section data.

Return values
mixed

output_small_dark_block()

Handles the outputting of a small dark block.

public static output_small_dark_block(object $block) : mixed
Parameters
$block : object

Block data.

Return values
mixed

output_small_light_block()

Handles the outputting of a small light block.

public static output_small_light_block(object $block) : mixed
Parameters
$block : object

Block data.

Return values
mixed

output_storefront_button()

Handles the outputting of a contextually aware Storefront link (points to child themes if Storefront is already active).

public static output_storefront_button() : mixed
Return values
mixed

output_wcs_banner_block()

Handles the outputting of the WooCommerce Services banner block.

public static output_wcs_banner_block([object $block = array() ]) : mixed
Parameters
$block : object = array()

Block data.

Return values
mixed

show_extension()

Should an extension be shown on the featured page.

public static show_extension(object $item) : bool
Parameters
$item : object

Item data.

Return values
bool