Last active
December 4, 2019 11:46
-
-
Save mgibbs189/d3bc1fde7a58e9e6e35ec9fe991965c7 to your computer and use it in GitHub Desktop.
Automatically create shortcode using the post ID
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 | |
add_filter( 'facetwp_builder_item_value', function( $value, $item ) { | |
if ( 'el-z9v5wp' == $item['settings']['name'] ) { | |
$shortcode = '[awts-total-sales product_id="' . $value . '" include_setting="true"]'; | |
$value = do_shortcode( $shortcode ); | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment