WordPress at Your Fingertips
function is not described

WC_Admin_Addons::get_sections() public WC 1.0

Get sections for the addons screen

{} It's a method of the class: WC_Admin_Addons{}

Hooks from the method

Return

Array. of objects

Usage

$result = WC_Admin_Addons::get_sections();

Code of WC_Admin_Addons::get_sections() WC 5.9.0

public static function get_sections() {
	$addon_sections = get_transient( 'wc_addons_sections' );
	if ( false === ( $addon_sections ) ) {
		$raw_sections = wp_safe_remote_get(
			'https://woocommerce.com/wp-json/wccom-extensions/1.0/categories'
		);
		if ( ! is_wp_error( $raw_sections ) ) {
			$addon_sections = json_decode( wp_remote_retrieve_body( $raw_sections ) );
			if ( $addon_sections ) {
				set_transient( 'wc_addons_sections', $addon_sections, WEEK_IN_SECONDS );
			}
		}
	}
	return apply_filters( 'woocommerce_addons_sections', $addon_sections );
}