WC_Admin_Addons::get_section_data()
Устарела с версии 5.9.0. Больше не поддерживается и может быть удалена. Используйте
d in In-App Marketplace
.Get section content for the addons screen.
Метод класса: WC_Admin_Addons{}
Хуки из метода
Возвращает
Массив
.
Использование
$result = WC_Admin_Addons::get_section_data( $section_id );
- $section_id(строка) (обязательный)
- Required section ID.
Список изменений
Устарела с 5.9.0 | No longer used in In-App Marketplace |
Код WC_Admin_Addons::get_section_data() WC Admin Addons::get section data WC 8.7.0
public static function get_section_data( $section_id ) { $section = self::get_section( $section_id ); $section_data = ''; if ( ! empty( $section->endpoint ) ) { $section_data = get_transient( 'wc_addons_section_' . $section_id ); if ( false === $section_data ) { $raw_section = wp_safe_remote_get( esc_url_raw( $section->endpoint ), array( 'user-agent' => 'WooCommerce/' . WC()->version . '; ' . get_bloginfo( 'url' ), ) ); if ( ! is_wp_error( $raw_section ) ) { $section_data = json_decode( wp_remote_retrieve_body( $raw_section ) ); if ( ! empty( $section_data->products ) ) { set_transient( 'wc_addons_section_' . $section_id, $section_data, WEEK_IN_SECONDS ); } } } } return apply_filters( 'woocommerce_addons_section_data', $section_data->products, $section_id ); }