relevanssi_oxygen_section_content

apply_filters( 'relevanssi_oxygen_section_content', string $content, int $post_id )

Filters the Oxygen Builder content sections before they are are indexed.

Parameters

$content
(string) The single section content.

$post_id
(int) The post ID.

More information

The Relevanssi Oxygen compatibility code is a filter function on the relevanssi_custom_field_value filter hook. It runs as part of the indexing process and manipulates the contents of the ct_builder_shortcodes custom field (where Oxygen keeps everything) so that it can be indexed correctly.

The process starts by splitting the content into sections based on [ct_section] shortcodes. Each section is then filtered with the filters defined by the relevanssi_oxygen_section_filters hook. The sections that are not removed there then have their content pass through this filter hook.

After this filter hook returns the content, Relevanssi then removes all [oxygen] and [ct_...] shortcodes from the content. All the section content is then compiled into one string, which is then passed through the relevanssi_do_shortcode() function that expands the shortcodes that remain in it.

Default functions

By default Relevanssi adds two functions to this filter hook:

  • relevanssi_oxygen_code_block() looks for [ct_code_block] shortcodes and runs base64_decode() on the Base64 encoded content of those blocks so that the contents of the HTML code blocks can be read.
  • relevanssi_oxygen_rich_text() removes the [oxy_rich_text] tags, because when those tags are removed, Relevanssi can index the contents.