Posted on

Oxygen and Ninja Tables

Relevanssi has support both for Oxygen and Ninja Tables, but the way the Ninja Tables support is done, it’s not working when used with Oxygen. The Ninja Tables support in Relevanssi is looking for the Ninja Tables shortcodes in the post content, but Oxygen keeps everything in custom fields.

Fortunately, the fix is simple: you can make Relevanssi look for the Ninja Tables shortcodes in the Oxygen custom fields. Add this code to a code snippet:

add_filter( 'relevanssi_custom_field_value', 'rlv_oxygen_ninja', 9, 2 );
function rlv_oxygen_ninja( $values, $field ) {
  if ( 'ct_builder_shortcodes' === $field ) {
	$values = array_map( 'relevanssi_index_ninja_tables', $values );
  }
  return $values;
}

Leave a Reply

Are you a Relevanssi Premium customer looking for support? Please use the Premium support form.

Your email address will not be published. Required fields are marked *