Plugin info

Total downloads: 1,180
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 6/8/2019 (2445 days ago)
Added to WordPress: 6/8/2019 (6 years old)
Minimum WordPress version: 4.8
Tested up to WordPress version: 5.2.23
Minimum PHP version: 5.4

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 2445 days ago

20/100

Is Advanced Custom Fields: Snippets abandoned?

Possibly abandoned (last update 2445 days ago).

Compatibility

Requires WordPress: 4.8
Tested up to: 5.2.23
Requires PHP: 5.4

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Code Snippets
Rating 4.7/5 (487 reviews)Active installs 1,000,000
Shortcoder — Create Shortcodes for Anything
Rating 4.9/5 (224 reviews)Active installs 100,000
Post Snippets – Custom WordPress Code Snippets Customizer
Rating 4.6/5 (93 reviews)Active installs 20,000
CSS & JavaScript Toolbox
Rating 4.7/5 (85 reviews)Active installs 10,000
WP Coder – Insert & Manage Code Snippets
Rating 4.9/5 (31 reviews)Active installs 10,000
Prismatic
Rating 4.8/5 (45 reviews)Active installs 2,000

Description

Adds useful functions for rendering image fields, link fields, repeater fields and flexible content for the Advanced Custom Fields plugin. For detailed info look on Bitbucket.

Main advantages

  • write less code (do not repet same blocks of the code when writing down ACF custom fields)
  • built-in filters
  • works also for Gutenberg ACF Blocks
  • no init hooks etc (no impact on performance)

Usage

Link

Returns the snippet of a specific link field.


Displays the snippet of a specific link field.


Parameters
$selector (string) (Required) ACF field name or ACF field key. Based on ACF get_field function.
$postId (integer|bool) (Optional) The post ID where the value is saved. Use true for getting sub field. Default value: false (current post).
$args (array) (Optional) Array of link output arguments. Default value: null.
    ‘class’ (string) class attribute of the anchor.
    ‘id’ (string) id attribute of the anchor.
    ‘title’ (string) title attribute text of the anchor.

Image

Returns the snippet of a specific image field.


Displays the snippet of a specific image field.


Parameters
$selector (string) (Required) ACF field name or ACF field key. Based on ACF get_field function.
$postId (integer|bool) (Optional) The post ID where the value is saved. Use true for getting sub field. Default value: false (current post).
$args (array) (Optional) Array of image output arguments. Default value: null.
    ‘size’ (string) Image size to use. Accepts any valid image size. Default value is full.
    ‘alt’ (string) alt attribute of the image.
    ‘id’ (string) id attribute of the image.
    ‘class’ (string) class attribute of the image.
    ‘title’ (string) title attribute of the image.
    ‘srcset’ (bool) Use true for retrieving image’s srcset attribute. Default value: false.
    ‘loading’ (string) loading attribute of the image. Default value: lazy.
    ‘link’ (bool|array) Array of attributes for anchor wrapped around the image. Default value: false.
        ‘href’ (string) href attribute of the link.
        ‘target’ (string) target attribute of the link.
        ‘class’ (string) class attribute of the link.
        ‘id’ (string) id attribute of the link.
        ‘title’ (string) title attribute of the link.

Repeater

Displays the snippet of a specific repeater field.


Parameters
$selector (string) (Required) ACF field name or ACF field key. Based on ACF get_field function.
$postId (integer|bool) (Optional) The post ID where the value is saved. Default value: false (current post).
$args (array) (Optional) Array of repeater output arguments. Default value: null.
    ‘template’ (string|array) Template for items inside the loop. Arguments of get_template_part function. In the template use standard get_sub_field function.
    ‘wrap_before’ (string) Text (HTML) before repeater items while have rows.
    ‘wrap_after’ (string) Text (HTML) after repeater items while have rows
    ’empty_html’ (string) Text (HTML) in case there are no rows in repeater.

Flexible content

Displays the snippet of a specific flexible field.


Parameters
$selector (string) (Required) ACF field name or ACF field key. Based on ACF get_field function.
$postId (integer|bool) (Optional) The post ID where the value is saved. Default value: false (current post).
$args (array) (Optional) Array of flexible content output arguments. Default value: null.
    ‘templates’ (array) Array of templates for flexible content layouts. In the templates use standard get_sub_field function.
        key (string) – layout name
        value (string|array) arguments for get_template_part function.

Requires Advanced Custom Fields (Pro)

Examples

Link field

 'link__out',
        ]
    );
?>

Image field

 'medium',
        'alt' => 'company name',
        'title' => false,
        'class' => 'header__logo',
        'id' => 'company-logo',
        'loading' => 'fetch',
        'link' => [
            'href' => get_home_url()
            ]
        ]
    );
?>

Repeater field

 [ 'templates/loops/loop', 'team-member' ],
        'wrap_before' => '
    ', 'wrap_after' => '
', 'empty_html' => '

' . __( 'No team members to show.', 'web' ) . '

' ] ); ?>

Flexible content field

 [
        'slider'          => [ 'templates/homepage/snippet', 'slider' ],
        'counters' => [ 'templates/homepage/snippet', 'counters' ],
        'text_block'    => [ 'templates/homepage/snippet', 'text_block' ]
        ]
    ] 
);

?>
`

Installation

No installation instructions available

Frequently Asked Questions

No FAQ available

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.0

  • init