Skip to content

Commit

Permalink
removed donation nag
Browse files Browse the repository at this point in the history
  • Loading branch information
Hube2 committed Dec 21, 2018
1 parent 58e8aae commit 7d3a70e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 61 deletions.
60 changes: 1 addition & 59 deletions acf-post2post.php
Expand Up @@ -4,7 +4,7 @@
Plugin Name: ACF Post-2-Post
Plugin URI: https://github.com/Hube2/acf-post2post
Description: Two way relationship fields
Version: 1.3.1
Version: 1.3.2
Author: John A. Huebner II
Author URI: https://github.com/Hube2
GitHub Plugin URI: https://github.com/Hube2/acf-post2post
Expand Down Expand Up @@ -39,23 +39,11 @@ public function plugins_loaded() {
}
add_filter('acf/update_value/type=relationship', array($this, 'update_relationship_field'), 11, 3);
add_filter('acf/update_value/type=post_object', array($this, 'update_relationship_field'), 11, 3);
add_filter('jh_plugins_list', array($this, 'meta_box_data'));
} // end public function plugins_loaded

public function missing_acf5() {
deactivate_plugins(plugin_basename( __FILE__ ));
} // end public function missing_acf5

public function meta_box_data($plugins=array()) {

$plugins[] = array(
'title' => 'Post2Post for ACF',
'screens' => array('acf-field-group', 'edit-acf-field-group'),
'doc' => 'https://github.com/Hube2/acf-post2post'
);
return $plugins;

} // public function meta_box_data

public function update_relationship_field($value, $post_id, $field) {
$update = true;
Expand Down Expand Up @@ -254,51 +242,5 @@ public function deactivate() {
} // end public function deactivate

} // end class acf_post2post

if (!function_exists('jh_plugins_list_meta_box')) {
function jh_plugins_list_meta_box() {
if (apply_filters('remove_hube2_nag', false)) {
return;
}
$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

?>
7 changes: 5 additions & 2 deletions readme.txt
Expand Up @@ -2,8 +2,8 @@
Contributors: Hube2
Tags: acf, advanced custom fields, add on, bidirectional, 2 way, two way, relationship
Requires at least: 4.0
Tested up to: 4.9
Stable tag: 1.3.1
Tested up to: 5.0
Stable tag: 1.3.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -100,6 +100,9 @@ add_filter('remove_hube2_nag', '__return_true');

== Changelog ==

= 1.3.2 =
* removed donation nag

= 1.3.1 =
* Corrected bug in 1.3.0 that prevented all fields from updating correctly

Expand Down

0 comments on commit 7d3a70e

Please sign in to comment.