Created
January 22, 2019 18:40
-
-
Save djrmom/b36cb7e58608e277a04a845a1b8786db to your computer and use it in GitHub Desktop.
facetwp shortcodes in layout builder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** use do_shortcode on a builder item **/ | |
add_filter( 'facetwp_builder_item_value', function( $value, $item ) { | |
if ( 'some_field' == $item['source'] ) { // replace some_field with your item source | |
$value = do_shortcode( $value ); // limit to 120 characters | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment