yes.
this would need to be done in a template or using a filter.
Template would use the do_shortcode function
<?php
echo do_shortcode("[expand title='trigger']". your_function() . "[/expand]");
?>
if you wanted to filter, you would need to hook into the ‘the_content‘ filter: https://developer.ww.wp.xz.cn/reference/hooks/the_content/
Best of luck!
Thread Starter
barb55
(@barb55)
Thank you. Can I also place php into the shortcode NOT in a template but a meta field?
Can I also place php into the shortcode
No. That is not how shortcodes work in WordPress.
Or do you have an example you can share?
Thread Starter
barb55
(@barb55)
Hi,
no, that’s why I was asking. It would be great if I could add the function inside the shortcode.
you might reach out to the developer of the php function you want to include in a shortcode, and ask if there is a shortcode available for it. In WordPress you can wrap one shortcode inside another.
Best of luck.