Skip to content

Commit

Permalink
added donation box
Browse files Browse the repository at this point in the history
  • Loading branch information
Hube2 committed Oct 8, 2016
1 parent 63e50ba commit 1953744
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions acf-input-counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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
Expand Down Expand Up @@ -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 = '<a style="text-decoration: none; font-size: 1em;" href="https://github.com/Hube2" target="_blank">Plugins by John Huebner</a>';
$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());
?>
<p style="margin-bottom: 0;">Thank you for using my plugins</p>
<ul style="margin-top: 0; margin-left: 1em;">
<?php
foreach ($plugins as $plugin) {
?>
<li style="list-style-type: disc; list-style-position:">
<?php
echo $plugin['title'];
if ($plugin['doc']) {
?> <a href="<?php echo $plugin['doc']; ?>" target="_blank">Documentation</a><?php
}
?>
</li>
<?php
}
?>
</ul>
<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
}
} // end if !function_exists

?>

0 comments on commit 1953744

Please sign in to comment.