Skip to content

Commit 1953744

Browse files
committed
added donation box
1 parent 63e50ba commit 1953744

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

acf-input-counter.php

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: ACF Input Counter
55
Plugin URI: https://github.com/Hube2/acf-input-counter/
66
Description: Show character count for limited text and textarea fields
7-
Version: 0.1.0
7+
Version: 1.1.0
88
Author: John A. Huebner II
99
Author URI: https://github.com/Hube2/
1010
GitHub Plugin URI: https://github.com/Hube2/acf-input-counter/
@@ -18,13 +18,25 @@
1818

1919
class acf_input_counter {
2020

21-
private $version = '0.1.0';
21+
private $version = '1.1.0';
2222

2323
public function __construct() {
2424
add_action('acf/render_field/type=text', array($this, 'render_field'), 20, 1);
2525
add_action('acf/render_field/type=textarea', array($this, 'render_field'), 20, 1);
2626
add_action('acf/input/admin_enqueue_scripts', array($this, 'scripts'));
27+
add_filter('jh_plugins_list', array($this, 'meta_box_data'));
2728
} // end public function __construct
29+
30+
function meta_box_data($plugins=array()) {
31+
32+
$plugins[] = array(
33+
'title' => 'ACF Input Counter',
34+
'screens' => array('acf-field-group', 'edit-acf-field-group'),
35+
'doc' => 'https://github.com/Hube2/acf-input-counter'
36+
);
37+
return $plugins;
38+
39+
} // end function meta_box
2840

2941
private function run() {
3042
// cannot run on field group editor or it will
@@ -107,5 +119,48 @@ private function check($allow, $exist) {
107119
} // end private function check
108120

109121
} // end class acf_input_counter
122+
123+
if (!function_exists('jh_plugins_list_meta_box')) {
124+
function jh_plugins_list_meta_box() {
125+
$plugins = apply_filters('jh_plugins_list', array());
126+
127+
$id = 'plugins-by-john-huebner';
128+
$title = '<a style="text-decoration: none; font-size: 1em;" href="https://github.com/Hube2" target="_blank">Plugins by John Huebner</a>';
129+
$callback = 'show_blunt_plugins_list_meta_box';
130+
$screens = array();
131+
foreach ($plugins as $plugin) {
132+
$screens = array_merge($screens, $plugin['screens']);
133+
}
134+
$context = 'side';
135+
$priority = 'low';
136+
add_meta_box($id, $title, $callback, $screens, $context, $priority);
137+
138+
139+
} // end function jh_plugins_list_meta_box
140+
add_action('add_meta_boxes', 'jh_plugins_list_meta_box');
141+
142+
function show_blunt_plugins_list_meta_box() {
143+
$plugins = apply_filters('jh_plugins_list', array());
144+
?>
145+
<p style="margin-bottom: 0;">Thank you for using my plugins</p>
146+
<ul style="margin-top: 0; margin-left: 1em;">
147+
<?php
148+
foreach ($plugins as $plugin) {
149+
?>
150+
<li style="list-style-type: disc; list-style-position:">
151+
<?php
152+
echo $plugin['title'];
153+
if ($plugin['doc']) {
154+
?> <a href="<?php echo $plugin['doc']; ?>" target="_blank">Documentation</a><?php
155+
}
156+
?>
157+
</li>
158+
<?php
159+
}
160+
?>
161+
</ul>
162+
<p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=hube02%40earthlink%2enet&lc=US&item_name=Donation%20for%20WP%20Plugins%20I%20Use&no_note=0&cn=Add%20special%20instructions%20to%20the%20seller%3a&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted" target="_blank">Please consider making a small donation.</a></p><?php
163+
}
164+
} // end if !function_exists
110165

111166
?>

0 commit comments

Comments
 (0)