PHP code example of samrap / acf-fluent

1. Go to this page and download the library: Download samrap/acf-fluent library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

samrap / acf-fluent example snippets




$heading = get_field('heading');

if (is_null($heading)) {
    $heading = get_the_title();
} else {
    $heading = esc_html($heading);
}




use Samrap\Acf\Acf;

$heading = Acf::field('heading')
                ->default(get_the_title())
                ->escape()
                ->get();