Archived topic
Custom hook shortcode within custom hook shortcode GPP 2.0...
1 reply · Started by Greg on March 1, 2021
I wanted to get your opinion on what I've done to make sure it's not a bad idea.
What I've done is used the code here: https://generatepress.com/forums/topic/hook/ to create a hook element with a query and loop that is placed on a page via a shortcode. Inside the hook element loop is another shortcode that links to another custom hook that is targeted by block element.
Using that block element and GPP 2.0 dynamic content I am able to create my own 'recent post' blocks with custom designs in the block editor using ACF fields.
This feels like it might be very useful when basic 'show posts' blocks don't have the design or custom fields needed even if it is incredibly hacked together.
I want to know if it will damage security or speed or anything else I'm unaware of.
Hi there,
I'm not exactly sure I follow what you're trying to achieve.
As for the hooks shortcode, here's an improvement from David's code. It can be dynamic.
To answer the security question: No it won't affect security.
It shouldn't affect speed that much unless your images are not well optimized.