Hi,
if you are a developer and you can play with PHP code, you can use a useful filter of plugin that gives you the ability to change the parameters inside an event.
Here an example:
add_filter( 'aepc_event_parameters', function( $params, $eventName ){
$params['content_ids'] = [ get_post_meta(get_the_ID(), 'customfieldID', true) ];
return $params;
});
This is just an example. Adapt it in your website.
Hi!
Thanks for getting back! I do write som PhP so thanks for the snippet.
I am not sure though the code you sent is working.
I tried the filter but it is not actually changing anything..
Also I see $eventName is not used? I tried setting this to ViewContent but it does not work?
I guess changing get_post_meta(get_the_ID(), ‘customfieldID’, true) to “22” would at change the content_ids to 22 at all places? Right?
Well OK, hope you can help!
Basically what I need to do is:
Make the content_ids in this screen dynamic (of ViewContent type) http://prntscr.com/mgumas
Hi,
I’m sorry, I forgot to mention two details, here the updated snippet example:
add_filter( 'aepc_event_parameters', function( $params, $eventName ){
if ($eventName === 'view_content') {
$params['content_ids'] = [ 22 ];
}
return $params;
}, 10, 2);
The new details are:
1. that 10, 2 as other parameters of add_filter, in order to accept the $eventName parameter;
2. in $eventName there is the “underscored” version of the original event name, so ViewContent -> view_content, Purchase -> purchase, AddToCart -> add_to_cart, and so on.
Then, I was able to test the code on my end and it works for me.
I hope this helps 🙂