https://github.com/colorful-tones/acf-options-pages-demo
An example plugin to demonstrate some possible use cases for ACF Options Pages.
https://github.com/colorful-tones/acf-options-pages-demo
Last synced: 25 days ago
JSON representation
An example plugin to demonstrate some possible use cases for ACF Options Pages.
- Host: GitHub
- URL: https://github.com/colorful-tones/acf-options-pages-demo
- Owner: colorful-tones
- Created: 2023-07-26T15:09:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-08T18:55:23.000Z (almost 2 years ago)
- Last Synced: 2025-03-31T16:34:46.293Z (2 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Options pages and site-wide fields with ACF
This is a WordPress plugin that requires the [ACF PRO plugin](https://www.advancedcustomfields.com/). This plugin demonstrates different ways to create Options pages with site-wide settings. These are often used to allow clients a centralized place to update and control site-wide settings.
👉 [Check out the playback recording from this workshop](https://www.youtube.com/watch?v=NAdxBHZImiQ) 👈
This plugin will create three different Options pages.
| Options page name | WP Admin URL | Description |
|---------|-------------|----------|
| Theme Settings | `wp-admin/admin.php?page=theme-general-settings` | This is created programmatically with ACF's [`acf_add_options_page()`](https://www.advancedcustomfields.com/resources/acf_add_options_page/) and [`acf_add_options_sub_page()`](https://www.advancedcustomfields.com/resources/acf_add_options_sub_page/). This was the traditional way of registering an Options Page prior to 6.2. |
| Site Settings | `wp-admin/admin.php?page=site-settings` | Utilizes the new, upcoming Options Page UI in ACF to register and save Options Page. The Options Pages are synced with ACF's Local JSON (see `demo-acf-plugin/inc/acf-json.php` and `demon-acf-plugin/acf-json/ui-options_page)_xxxxxxxxxxxx.json`) |
| Theme Settings (WordPress way) | `wp-admin/admin.php?page=wp-core-theme-settings` | A simple example of using WordPress core's Settings & Options APIs to create Options Pages (the hard way). |