get_url_params( $editor_layout_type ); $url = add_query_arg( $query_args, static::API_TEMPLATES_URL ); $response = wp_remote_get( $url, [ 'headers' => apply_filters( 'stg-cf-headers', [] ), ] ); if ( is_wp_error( $response ) || 200 !== (int) wp_remote_retrieve_response_code( $response ) ) { return false; } $templates_data = json_decode( wp_remote_retrieve_body( $response ), true ); if ( empty( $templates_data ) || ! is_array( $templates_data ) ) { return []; } return $templates_data; } protected function get_url_params( string $editor_layout_type ): array { return [ 'products' => 'ehp', 'editor_layout_type' => $editor_layout_type, ]; } }