Support

Account

Home Forums General Issues How do I use acf/load_value correctly? Reply To: How do I use acf/load_value correctly?

  • Hi Elliot thanks for the heads-up and first-class support.

    For those that are interested, I resolved my issue with the following code:

    function MY_FUNCTION_NAME( $value ) {
    	if ( !$value ) : // IF VALUE EMPTY, RETURN NEW VALUE
    		$value = get_field( 'MY_CUSTOM_FIELD_NAME', $POST_ID) );
    		return $value;
    	endif;
    		return $value; // RETURN EXISTING VALUE
    };
    add_filter( 'acf/load_value/name=MY_CUSTOM_FIELD_NAME', 'MY_FUNCTION_NAME' );