Skip to content

Instantly share code, notes, and snippets.

@msaari
Last active June 27, 2020 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msaari/8c6c62e40b841d07b1961994c3331004 to your computer and use it in GitHub Desktop.
Save msaari/8c6c62e40b841d07b1961994c3331004 to your computer and use it in GitHub Desktop.
Index TablePress shortcodes in ACF fields
<?php
add_filter( 'relevanssi_custom_field_value', 'rlv_tablepress_in_acf' );
function rlv_tablepress_in_acf( $value ) {
$tablepress_controller = relevanssi_enable_tablepress_shortcodes();
$post_before_shortcode = $post;
$value[0] = do_shortcode( $value[0] );
$post = $post_before_shortcode;
unset( $tablepress_controller );
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment