Archived topic
more efficient - filter or customiser
3 replies · Started by Natalie on February 13, 2018
before purchasing GP premium, I set up some filters / functions for specific things
e.g. to hide the author on the posts I put this in my child theme functions.php
add_filter('generate_post_author', 'mc_generate_post_author');
function mc_generate_post_author() {
return false;
}
Now with GP premium I can go to customise / layout / blog and untick 'Display post author'
Which is more efficient in terms of code size / speed etc? (not just for that example but in general)
I'm perfectly happy writing the filters and functions - I just needed the GP premium to get all the hooks I needed
Thanks
Hi Natalie,
The filters are built into GPP, so you may as well use the built in filters instead of adding your own. However, the difference in code size/efficiency is practically nothing - I wouldn't worry about it if you prefer to write your own filters.
That being said, having your own filters might cause some confusion if you forget about them and try changing the Customizer options.
Let me know if you have any other questions :)
excellent! Thanks so much for your prompt reply
No problem! :)