Hi
I am trying to create a Custom Hook for my Looper which needs access to the current post id of the page
I have followed the instructions given in this post: Custom Looper params with dynamic content but it doesn’t seem to work as specified
Here is my hook
add_filter( 'cs_looper_custom_service_faq', function( $result, $params) {
$args = array(
'post_type' => 'faq',
'post_status' => 'publish',
);
$query = get_posts( $args );
return $query;
}, 10, 2);
And here is the JSON Supplied in the builder
{
"postId":"{{dc:post:id}}"
}
If i try to var_dump the content of $params inside the code i get the following on page render
array(1) { ["postId"]=> string(14) "168" }
as seen it says that postId is a 14 char string, but the value is the post id. This seems to be that the postId inside the code actually holds the string value “{{dc:post:id}}” (as that is 14 chars) and not the post id.
So it seems like the value being sent to the hook isn’t evaluated before being executed or something similiar
I am running Pro Version: 5.1.5