NOTE:
This is an extension for the popular Advanced Custom Fields plugin. By itself, this plugin does NOTHING. ENDNOTE
Generates a nice button/link to an external url or an internal post type, similar to the page_link field but allows you to override the link text.
What makes this great is reducing two ACF rows into just one (see screenshots for a clear visual walkthrough). The internal link also uses a dropdown which is populated from all your post types so the button can link to a media file or a Custom Post Type, or of course to a page or post.
NOTE: (
I know it was already mentioned, but just to be sure there's no confusion...)
This is an extension for the popular Advanced Custom Fields plugin. By itself, this plugin does NOTHING. ENDNOTE
Future Plans
Not much really. Probably just a couple things as the need arises:
- Add a filter for media types since the dropdown can get kinda totally out of control.
- Add a target field as well. This would allow for _blank and even "foobox" to be targeted.
- Add a checkbox to enable "rel=nofollow".
This add-on can be treated as both a WP plugin and a theme include.
Plugin
- Copy the 'acf-button' folder into your plugins folder
- Activate the plugin via the Plugins admin page
Theme Include
- Copy the 'acf-button' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
- Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-button.php file)
`
add_action('acf/register_fields', 'my_register_fields');
function my_register_fields()
{
include_once('acf-button/acf-button.php');
}
`
== Frequently Asked Questions ==
Why doesn't my link look like a button?
I figure if you are using ACF then you're probably pretty comfortable styling this however you like.
Can I contribute?
I'd LOVE that! Development of this happens over
here.
When are you going to implement those "Future plans"?
As the need arises per client requests. Meaning: Don't hold your breath. Of course, if you want to contribute to those future plans, see previous FAQ.
Forked from:
https://github.com/envex/acf-button-field
The original didn't seem to be updated or maintained, and I needed this for a client, so this is the fork.
Here's a quick list of the updates made:
1.0
- Removed all ACF 3 code (really no need for that)
- Fixed bug with $button = $field['value'];
- Added class names to button output for unique styling. Class names automatically output based on Field label.