WP Manifestindependent plugin directory
manifest / admin / modern-acf-options

Modern ACF Options WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

A modern approach to ACF Theme Options

★ 34stars
v1.0.3latest · 6 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/log1x/modern-acf-options/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Here lives a simple mu-plugin to modernize and brand theme options created with ACF. No admin panels, no bloat – just a simple filter to optionally customize the CSS properties with your color palette.

Screenshot

Requirements

Installation

Bedrock

Install via Composer:

$ composer require log1x/modern-acf-options

Manual

Download the release .zip and install into wp-content/plugins.

Usage

The styling for Modern ACF Options requires the usage of seamless mode and tabs with their placement set to left.

Example using ACF Builder

use StoutLogic\AcfBuilder\FieldsBuilder;

acf_add_options_page([
    'page_title' => get_bloginfo('name'),
    'menu_title' => 'Theme Options',
    'menu_slug' => 'theme-options',
    'update_button' => 'Update Options',
    'capability' => 'edit_theme_options',
    'position' => '999',
    'autoload' => true,
]);

$options = new FieldsBuilder('theme_options', [
    'style' => 'seamless',
]);

$options
    ->setLocation('options_page', '==', 'theme-options');

$options
    ->addTab('general')
        ->setConfig('placement', 'left')

        ->addAccordion('customization')
          ->addImage('logo')

        ->addAccordion('tracking')
            ->addText('gtm')
                ->setConfig('label', 'Google Tag Manager')
        ->addAccordion('tracking_end')->endpoint()

    ->addTab('advanced')
        ->setConfig('placement', 'left')

        ->addTrueFalse('debug')
          ->setConfig('ui', '1');

acf_add_local_field_group($options->build());

Customization

To customize the color palette, simply pass an array containing one or more of the colors you would like to change to the acf_color_palette filter:

add_filter('acf_color_palette', function () {
    return [
        'brand' => '#0073aa',
        'trim' => '#181818',
    ];
});

Disabling Screen Options Tab

use Illuminate\Support\Str;

/**
 * Disable Screen Options on the theme options page.
 *
 * @param  bool       $show
 * @param  \WP_Screen $screen
 * @return bool
 */
add_filter('screen_options_show_screen', function ($show, $screen) {
    if (is_a($screen, 'WP_Screen') && Str::contains($screen->base, 'theme-options')) {
        return false;
    }
}, 1, 2);

Remove Admin Footer Text

/**
 * Remove admin footer text.
 *
 * @return bool
 */
add_filter('admin_footer_text', '__return_false', 100);

Development

Modern ACF Options is built using TailwindCSS and compiled with Laravel Mix.

$ yarn install
$ yarn run start

Todo

  • Continue optimizing/cleaning up existing styles.
  • Add styles for ACF switches, input fields (focus, hover), buttons, etc.

Bug Reports

If you discover a bug in Modern ACF Options, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

Modern ACF Options is provided under the MIT License.

Releases

4 releases.

Tag
Published
v1.0.3 latest
Aug 26, 2020 6 years ago
Jan 1, 2020 6 years ago
Dec 15, 2019 6 years ago
Dec 15, 2019 6 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

Modern ACF Options 1.0.3 · audited by WP Registry

No security issues found.

Audited release
1.0.3
Findings
none
Worst severity
—
Content hash
39bccdba11a9a2b91a0ec75a…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.