PHPackages                             gillesgoetsch/acf-smart-button - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gillesgoetsch/acf-smart-button

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

gillesgoetsch/acf-smart-button
==============================

A simple, clean and lean ACF Field for internal and external links.

1.0.4(5y ago)7625.5k↓25.9%15[1 PRs](https://github.com/gillesgoetsch/acf-smart-button/pulls)GPLv2.0+PHPPHP &gt;=5.3.2

Since Apr 4Pushed 5y ago4 watchersCompare

[ Source](https://github.com/gillesgoetsch/acf-smart-button)[ Packagist](https://packagist.org/packages/gillesgoetsch/acf-smart-button)[ RSS](/packages/gillesgoetsch-acf-smart-button/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

ACF Smart Button
================

[](#acf-smart-button)

A simple, clean and lean ACF Field that allows the user to select an internal link as a post\_object or an external link as a url field via a smooth toggle.

It always returns the url as the same field, whether it's an internal or external link. With button.target you can additionally add target="\_blank" in your template without additional casing.

[![alt tag](https://cloud.githubusercontent.com/assets/2161918/11077731/e4106c2e-8801-11e5-8c71-ef265a428a3c.png)](https://cloud.githubusercontent.com/assets/2161918/11077731/e4106c2e-8801-11e5-8c71-ef265a428a3c.png)

[![alt tag](https://cloud.githubusercontent.com/assets/2161918/11077733/e5643a06-8801-11e5-93f2-b99aba00e971.png)](https://cloud.githubusercontent.com/assets/2161918/11077733/e5643a06-8801-11e5-93f2-b99aba00e971.png)

Example (twig style):

```
{% if button %}
  {{ button.text }}
{% endif %}

```

Isn't that lean =)?

Example (vanilla PHP):

```
if ( get_field( 'acf_button_field' ) ) :
  $button = get_field( 'acf_button_field' );
  $button_label = $button['text'];
  $button_url = $button['url'];
  $button_target = $button['target'];
endif;

```

Output / Return
---------------

[](#output--return)

### When Internal

[](#when-internal)

\[text\] =&gt; I am an internal button
\[url\] =&gt;
\[target\] =&gt; ''

### When External

[](#when-external)

\[text\] =&gt; I am an external button
\[url\] =&gt;
\[target\] =&gt; 'target="blank"'

**Note:** In both cases the field data will only be returned if the button text is set in combination with a target. If either one is missing, there will be no data returned.

Future Plans
------------

[](#future-plans)

- option to select allowed post\_types for post\_object selector 7626ad4
- language support
- validate url field
- cleanups etc.
- eventually acf4 support (no?)

Compatibility
-------------

[](#compatibility)

This add-on works only with version 5 and up.

Installation
------------

[](#installation)

This add-on can be treated as both a WP plugin and a theme include.

**Install as Plugin**

1. Copy the 'acf-button' folder into your plugins folder
2. Activate the plugin via the Plugins admin page

**Include within theme**

1. Copy the 'acf-smart-button' folder into your theme folder (can use sub folders). You can place the folder anywhere inside the 'wp-content' directory
2. Edit your functions.php file and add the code below (Make sure the path is correct to include the acf-button.php file)

```
include_once('acf-smart-button/acf-smart-button.php');
```

Else
----

[](#else)

Partially inspired by , but is missing acf5 support and didn't meet my requirements fully.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 80.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~298 days

Total

5

Last Release

2140d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2161918?v=4)[gillesgoetsch](/maintainers/gillesgoetsch)[@gillesgoetsch](https://github.com/gillesgoetsch)

---

Top Contributors

[![gillesgoetsch](https://avatars.githubusercontent.com/u/2161918?v=4)](https://github.com/gillesgoetsch "gillesgoetsch (33 commits)")[![daviddarke](https://avatars.githubusercontent.com/u/1636310?v=4)](https://github.com/daviddarke "daviddarke (3 commits)")[![deJong](https://avatars.githubusercontent.com/u/1932851?v=4)](https://github.com/deJong "deJong (2 commits)")[![cyberwani](https://avatars.githubusercontent.com/u/1647283?v=4)](https://github.com/cyberwani "cyberwani (1 commits)")[![davemac](https://avatars.githubusercontent.com/u/498512?v=4)](https://github.com/davemac "davemac (1 commits)")[![jameelmoses](https://avatars.githubusercontent.com/u/16327472?v=4)](https://github.com/jameelmoses "jameelmoses (1 commits)")

---

Tags

pluginwordpressbuttonacf

### Embed Badge

![Health badge](/badges/gillesgoetsch-acf-smart-button/health.svg)

```
[![Health](https://phpackages.com/badges/gillesgoetsch-acf-smart-button/health.svg)](https://phpackages.com/packages/gillesgoetsch-acf-smart-button)
```

###  Alternatives

[philippbaschke/acf-pro-installer

An install helper for Advanced Custom Fields PRO

283724.6k](/packages/philippbaschke-acf-pro-installer)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28656.0k4](/packages/samrap-acf-fluent)[mcguffin/acf-customizer

Use ACF Fields in customizer.

7611.3k](/packages/mcguffin-acf-customizer)[iceicetimmy/acf-post-type-selector

Post type selector for Advanced Custom Fields.

559.0k](/packages/iceicetimmy-acf-post-type-selector)[webdevstudios/cmb2-attached-posts

Custom field for CMB2 for creating post relationships.

13565.5k](/packages/webdevstudios-cmb2-attached-posts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
