Skip to content

Commit

Permalink
moved bitch notice
Browse files Browse the repository at this point in the history
  • Loading branch information
gordielachance authored and gordielachance committed Sep 14, 2016
1 parent d22944a commit 4fe82f9
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions bbppu-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class bbP_Pencil_Unread_Settings {
function __construct() {
add_action( 'admin_menu', array( $this, 'create_admin_menu' ) );
add_action( 'admin_init', array( $this, 'settings_init' ) );
add_action( 'current_screen', array( $this, 'review_rate_donate_notice') );


}
Expand Down Expand Up @@ -142,26 +141,23 @@ function reset_options_callback(){
__("Reset options to their default values.","bbppu")
);
}

//TO FIX TO CHECK, seems to be fired twice
function review_rate_donate_notice(){

if ( !bbppu()->is_bbppu_admin() ) return;

$rate_link_wp = 'https://wordpress.org/support/view/plugin-reviews/bbpress-pencil-unread?rate#postform';
$rate_link = '<a href="'.$rate_link_wp.'" target="_blank" href=""><i class="fa fa-star"></i> '.__('Reviewing it','bbppu').'</a>';
$donate_link = '<a href="http://bit.ly/gbreant" target="_blank" href=""><i class="fa fa-usd"></i> '.__('make a donation','bbppu').'</a>';

add_settings_error('bbppu_option_group', 'review_rate_donate',
sprintf(__('Happy with this plugin ? %s and %s would help!','bbppu'),$rate_link,$donate_link)
);
}


function settings_page() {
?>
<div class="wrap">
<h2><?php _e('bbPress Pencil Unread Settings','bbppu');?></h2>

<div>
<?php
$rate_link_wp = 'https://wordpress.org/support/view/plugin-reviews/bbpress-pencil-unread?rate#postform';
$rate_link = '<a href="'.$rate_link_wp.'" target="_blank" href=""><i class="fa fa-star"></i> '.__('Reviewing it','bbppu').'</a>';
$donate_link = '<a href="http://bit.ly/gbreant" target="_blank" href=""><i class="fa fa-usd"></i> '.__('make a donation','bbppu').'</a>';

echo '<p><em>'.sprintf(__('Great experience with this plugin ? %s and %s would help us maintaining it !','bbppu'),$rate_link,$donate_link).'</em></p>';
?>
</div>
<hr/>
<?php settings_errors('bbppu_option_group');?>
<form method="post" action="options.php">
<?php
Expand Down

0 comments on commit 4fe82f9

Please sign in to comment.