<commit_before># ACF Fluent

[![StyleCI](https://styleci.io/repos/82142588/shield?branch=master)](https://styleci.io/repos/82142588)
[![Travis branch](https://img.shields.io/travis/samrap/acf-fluent/master.svg?style=flat-square)]()
[![GitHub issues](https://img.shields.io/github/issues/samrap/acf-fluent.svg?style=flat-square)](https://github.com/samrap/acf-fluent/issues)
[![Twitter](https://img.shields.io/twitter/url/http/github.com/samrap/acf-fluent.svg?style=social&style=flat-square)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D)

A [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) for the Advanced Custom Fields WordPress plugin.

### Why?

If you make heavy use of ACF fields in your WordPress templates (you should), then you probably find yourself writing a lot of repetitive code just to print out your fields. For example, you might have a `heading` field for your page's hero section:

```php
<?php

$heading = get_field('heading');

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

?>
<commit_msg>Update readme.<commit_after># ACF Fluent

[![StyleCI](https://styleci.io/repos/82142588/shield?branch=master)](https://styleci.io/repos/82142588)
[![Travis branch](https://img.shields.io/travis/samrap/acf-fluent/master.svg?style=flat-square)]()
[![GitHub issues](https://img.shields.io/github/issues/samrap/acf-fluent.svg?style=flat-square)](https://github.com/samrap/acf-fluent/issues)
[![Twitter](https://img.shields.io/twitter/url/http/github.com/samrap/acf-fluent.svg?style=social&style=flat-square)](https://twitter.com/intent/tweet?text=A+fluent+interface+for+the+Advanced+Custom+Fields+%23WordPress+plugin:&url=https%3A%2F%2Fgithub.com%2Fsamrap%2Facf-fluent)

A [fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) for the Advanced Custom Fields WordPress plugin.

### Why?

If you make heavy use of ACF fields in your WordPress templates (you should), then you probably find yourself writing a lot of repetitive code just to print out your fields. For example, you might have a `heading` field for your page's hero section:

```php
<?php

$heading = get_field('heading');

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

?>

{'fraction_non_alphanumeric': 0.16437768240343348, 'fraction_numerical': 0.018454935622317595, 'mean_word_length': 5.876106194690266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2159927', 'n_tokens_mistral': 835, 'n_tokens_neox': 786, 'n_words': 151}