Support

Account

Home Forums Front-end Issues How to get field value inside custom plugin

Helping

How to get field value inside custom plugin

  • Hi,
    I have custom plugin and its creating custom content type and how to display it as well, How can i get the field value inside that plugin.?

    Thanks

  • Hi @woody

    You can always use the get_field() function to grab the values of the custom fields, store them in a variable and later echo them with the same function. You can use the following code in your template:

    $value = get_field( “text_field” );

    if( $value ) {

    echo $value;

    } else {

    echo ’empty’;

    }

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘How to get field value inside custom plugin’ is closed to new replies.