2 added 43 characters in body
source | link

Currently I have three functions that run on pre_get_posts. I call them like this:

add_action( 'pre_get_posts', 'private_groups' );
add_action( 'pre_get_posts', 'search_results' );
add_action( 'pre_get_posts', 'name_profiles' );

This allows me to keep the functions neat and separate, but is calling to the same action three times, versus calling a combined function once, a drain on resources?

Currently I have three functions that run on pre_get_posts. I call them like this:

add_action( 'pre_get_posts', 'private_groups' );
add_action( 'pre_get_posts', 'search_results' );
add_action( 'pre_get_posts', 'name_profiles' );

This allows me to keep the functions neat and separate, but is calling to the same action three times a drain on resources?

Currently I have three functions that run on pre_get_posts. I call them like this:

add_action( 'pre_get_posts', 'private_groups' );
add_action( 'pre_get_posts', 'search_results' );
add_action( 'pre_get_posts', 'name_profiles' );

This allows me to keep the functions neat and separate, but is calling to the same action three times, versus calling a combined function once, a drain on resources?

    Tweeted twitter.com/StackWordPress/status/688001151413915648
1
source | link

Does hooking into the same action multiple times drain memory?

Currently I have three functions that run on pre_get_posts. I call them like this:

add_action( 'pre_get_posts', 'private_groups' );
add_action( 'pre_get_posts', 'search_results' );
add_action( 'pre_get_posts', 'name_profiles' );

This allows me to keep the functions neat and separate, but is calling to the same action three times a drain on resources?