• Resolved fmr1971

    (@fmr1971)


    Hi Aires,

    With ACF To Rest Api I can show in Wp Rest Api the values of the Field Name.
    So if I have a custom field with Field Label “Year”, Field Name “year” and a value “2017” in json response I find:

    “acf”: {
    “year”: “2017”
    },

    but is it possible to show in Rest the Field Label too?
    Or is it possible to show in Json response not the Field Name and his value but the Field Label with the value of Field Name?

    I make this question because I’d like to translate the name of the field, but I can’t translate a field name but only a field label.
    I hope I’ve been sufficiently clear exposing my problem.

    Thank You for Your attention.

    Filippo

    • This topic was modified 6 years, 11 months ago by fmr1971.
Viewing 1 replies (of 1 total)
  • Plugin Author airesvsg

    (@airesvsg)

    Hi @fmr1971,
    Please, use the filter acf/rest_api/{type}/get_fields.

    The wildcard {type} can be: post | user | comment | attachment | custom post type | taxonomy

    add_filter( 'acf/rest_api/{type}/get_fields', function( $data ) {
    	// your code here
    	return $data;
    } );

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Show the Field Label Values in Acf Rest Api’ is closed to new replies.