Skip to content

Commit 6bcde86

Browse files
committed
Add link to htmlBurger
1 parent 2881cf6 commit 6bcde86

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is a simple plugin used to load the latest **_release_** version of [Carbon Fields](http://carbonfields.net/).
44

5-
This plugin is **not** officially supported by htmlBurger, the makers of Carbon Fields.
5+
This plugin is **not** supported by [htmlBurger](https://htmlburger.com), the makers of Carbon Fields.
66

77
**What is the point?** None really, unless you want to run a different version of Carbon Fields than what is on the wordpress.org repo.
88

@@ -15,19 +15,19 @@ I'm not going to do a release until this thing isn't terrible.
1515
(I haven't actually tested this yet - I just created this repo.)
1616

1717
* WordPress 4.0 or higher
18-
* PHP 5.3.29 or higher
18+
* PHP 5.3 or higher
1919

2020
## How do I use it correctly with my plugin/theme?
2121

2222
If you want to use this plugin to load Carbon Fields for use with your plugin or theme, you would probably want to do something like this:
2323

2424
```
25-
function load_my_magic() {
26-
// Do something swell
25+
function do_plugin_logic() {
26+
// Load plugin logic
2727
}
2828
2929
add_action( 'plugins_loaded', array( 'Carbon_Fields\\Carbon_Fields', 'boot' ) );
30-
add_action( 'carbon_fields_loaded', 'load_my_magic' );
30+
add_action( 'carbon_fields_loaded', 'do_plugin_logic' );
3131
```
3232

3333
## Version Checking
@@ -37,13 +37,6 @@ Since it is possible that an older version of the plugin may be installed and/or
3737
**Quick example:**
3838

3939
```
40-
add_action( 'plugins_loaded', array( 'Carbon_Fields\\Carbon_Fields', 'boot' ) );
41-
add_action( 'carbon_fields_loaded', 'load_my_magic' );
42-
43-
if(verify_dependencies(['carbon_fields' => '2.0.0'])) {
44-
// Execute my super-awesome plugin logic
45-
}
46-
4740
function verify_dependencies( $deps ) {
4841
// Check if outdated version of Carbon Fields loaded
4942
$error = false;
@@ -64,6 +57,15 @@ function verify_dependencies( $deps ) {
6457
6558
return !$error;
6659
}
60+
61+
function do_plugin_logic() {
62+
if(verify_dependencies(['carbon_fields' => '2.0.0'])) {
63+
// Load plugin logic
64+
}
65+
}
66+
67+
add_action( 'plugins_loaded', array( 'Carbon_Fields\\Carbon_Fields', 'boot' ) );
68+
add_action( 'carbon_fields_loaded', 'do_plugin_logic' );
6769
```
6870

6971
## Frequently Asked Questions

0 commit comments

Comments
 (0)