Skip to Content
Menu

always_get_post_custom()

Always get custom fields with post queries.

PHP April 26, 2017

Usage

This function runs automatically, so it is not called manually. Is this incorrect?

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Functions.php on line 2425.

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function always_get_post_custom($posts){
                $posts_count = count($posts);
                for ( $i = 0; $i < $posts_count; $i++ ){
                    $custom_fields = get_post_custom($posts[$i]->ID);
                    $posts[$i]->custom_fields = $custom_fields;
                }
                return $posts;
            }
    

    Override

    This function can not be short-circuited with an override filter. Request one?