From 19537447bf9dd69f42509d6c3bcb9bb4e9942eb5 Mon Sep 17 00:00:00 2001 From: John Huebner Date: Sat, 8 Oct 2016 09:11:25 -0400 Subject: [PATCH] added donation box --- acf-input-counter.php | 59 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/acf-input-counter.php b/acf-input-counter.php index d72c5e1..c6f3404 100644 --- a/acf-input-counter.php +++ b/acf-input-counter.php @@ -4,7 +4,7 @@ Plugin Name: ACF Input Counter Plugin URI: https://github.com/Hube2/acf-input-counter/ Description: Show character count for limited text and textarea fields - Version: 0.1.0 + Version: 1.1.0 Author: John A. Huebner II Author URI: https://github.com/Hube2/ GitHub Plugin URI: https://github.com/Hube2/acf-input-counter/ @@ -18,13 +18,25 @@ class acf_input_counter { - private $version = '0.1.0'; + private $version = '1.1.0'; public function __construct() { add_action('acf/render_field/type=text', array($this, 'render_field'), 20, 1); add_action('acf/render_field/type=textarea', array($this, 'render_field'), 20, 1); add_action('acf/input/admin_enqueue_scripts', array($this, 'scripts')); + add_filter('jh_plugins_list', array($this, 'meta_box_data')); } // end public function __construct + + function meta_box_data($plugins=array()) { + + $plugins[] = array( + 'title' => 'ACF Input Counter', + 'screens' => array('acf-field-group', 'edit-acf-field-group'), + 'doc' => 'https://github.com/Hube2/acf-input-counter' + ); + return $plugins; + + } // end function meta_box private function run() { // cannot run on field group editor or it will @@ -107,5 +119,48 @@ private function check($allow, $exist) { } // end private function check } // end class acf_input_counter + + if (!function_exists('jh_plugins_list_meta_box')) { + function jh_plugins_list_meta_box() { + $plugins = apply_filters('jh_plugins_list', array()); + + $id = 'plugins-by-john-huebner'; + $title = 'Plugins by John Huebner'; + $callback = 'show_blunt_plugins_list_meta_box'; + $screens = array(); + foreach ($plugins as $plugin) { + $screens = array_merge($screens, $plugin['screens']); + } + $context = 'side'; + $priority = 'low'; + add_meta_box($id, $title, $callback, $screens, $context, $priority); + + + } // end function jh_plugins_list_meta_box + add_action('add_meta_boxes', 'jh_plugins_list_meta_box'); + + function show_blunt_plugins_list_meta_box() { + $plugins = apply_filters('jh_plugins_list', array()); + ?> +

Thank you for using my plugins

+ +

Please consider making a small donation.