[Resolved] more efficient – filter or customiser

Home Forums Support [Resolved] more efficient – filter or customiser

Home Forums Support more efficient – filter or customiser

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #495113
    Natalie

    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

    #495451
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #495846
    Natalie

    excellent! Thanks so much for your prompt reply

    #495848
    Tom
    Lead Developer
    Lead Developer

    No problem! ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.