Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Hube2 committed Dec 21, 2018
1 parent c1e0cd7 commit 8341433
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Allows adding options pages though an admin interface. Supports all the features
ACF Options Pages. For more information see
http://www.advancedcustomfields.com/resources/options-page/

## Change capabilit
## Change capability
The capability required to add/edit options pages was changed to "manage_options" in version 3.3.0.
This can be altered by adding a filter
```
Expand Down Expand Up @@ -81,7 +81,7 @@ In other words, the slug must be all lower case and contain only letters, number

Options page groups added using this plugin work correctly as this problem is dealt with internally.

##Saving options page values to a post ID
## Saving options page values to a post ID
ACF v5.2.7 added the ability to save options page fields to a post ID, so here's a hint.
Why not save your values to the options page post that is created when you set up an options page using
this plugin? The post type is already created and it really is a perfect place to store the values. Here's
Expand All @@ -92,6 +92,10 @@ underscore `_` and will not be returned by `get_fields()`. The only thing you ne
using any of the field names used by this plugin, which should be extremely easy since they all start with
`_acfop_`.

## Saving options page values with a custom slug as the post ID
It is posible to use a custom slug for saving options page values. For example, if you wanted to save values of an options page to a user you could supply "user_1" as the "$post_id" value for the opitons page. This also has another side effect. Normally, when ACF saves values to "options" in the options table you will find the fields with the "options_" prefix. So for example, if your field name is "my_field" then in the options table you will find "options_my_field" as the options name. You can supply a custom slug for this, let's say that you set the post ID setting for the options page to "my-custom-slug". this would cause the same field in the options page to have the name "my-custom-slug_my_field". 2 New options have been added to this plugin and you can choose to use the options page slug for the post ID or you can specify a custom slug to use instead.


## Customize Options Page
Version 3.8.0 of this plugin added the ability to customize the ACF options page by adding header and footer content. In addtion to the WYSIWYG fields that have been added to the options page admin editor you can also customize these sections, or the entire options page using filters.

Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Allows easy creation of options pages using Advanced Custom Fields Pro without n

== Description ==

*** New feature added: Custom Post ID Slugs ***

This is an add on plugin for Advanced Custom Fields (ACF) 5 + the Options Page Add On (or ACF Pro).
***This plugin will not provide any functionality unless ACF 5 and the Options Page Add On (or ACF5 Pro)
is installed***
Expand Down Expand Up @@ -66,6 +68,9 @@ function my_acf_options_page_adder_cap($cap) {

ACF v5.2.7 added the ability to save options page fields to a post ID. This plugin will let you save the options to the same post ID of the post created when adding an options page using this plugin. You can even use get_fields($options_page_id) without needing to worry about getting the fields for the options page itself. Why? because all the fields used for creating the options page start with an underscore _ and will not be returned by get_fields(). The only thing you need to be careful of is not using any of the field names used by this plugin, which should be extremely easy since they all start with _acfop_.

== Saving Values Using a Custom post ID slug ==
It is posible to use a custom slug for saving options page values. For example, if you wanted to save values of an options page to a user you could supply "user_1" as the $post_id value for the opitons page. This also has another side effect. Normally, when ACF saves values to "options" in the options table you will find the fields with the "options_" prefix. So for example, if your field name is "my_field" then in the options table you will find "options_my_field" as the options name. You can supply a custom slug for this, let's say that you set the post ID setting for the options page to "my-custom-slug". this would cause the same field in the options page to have the name "my-custom-slug_my_field". 2 New options have been added to this plugin and you can choose to use the options page slug for the post ID or you can specify a custom slug to use instead.

== Get Post ID for Options Page ==

A function and a filter are available for getting the correct ACF $post_id value to use for getting
Expand Down

0 comments on commit 8341433

Please sign in to comment.