Skip to content

Commit

Permalink
4.4.40
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbart committed Jul 20, 2021
1 parent 5034b5e commit 052c724
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions core/modules/class-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ public function save_vote()
$value = sanitize_text_field($_POST['value']);
}

if (is_user_logged_in() && 'on' === get_option('helpful_wordpress_user')) {
$user_id = get_current_user_id();
}

if (false === Helpers\User::check_user($user_id, $post_id)) {
if ('pro' === $value) {
Helpers\Values::insert_pro($user_id, $post_id);
Expand Down
1 change: 1 addition & 0 deletions core/tabs/class-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function register_settings()
'helpful_shrink_admin_columns',
'helpful_feedback_widget',
'helpful_feedback_disabled',
'helpful_wordpress_user',
];

$fields = apply_filters( 'helpful_details_settings_group', $fields );
Expand Down
2 changes: 1 addition & 1 deletion helpful.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Helpful
* Description: Add a fancy feedback form under your posts or post-types and ask your visitors a question. Give them the abbility to vote with yes or no.
* Version: 4.4.39
* Version: 4.4.40
* Author: Pixelbart
* Author URI: https://pixelbart.de
* Text Domain: helpful
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: helpful, poll, feedback, reviews, vote, review, voting
Requires at least: 4.6
Tested up to: 5.8
Requires PHP: 5.6.20
Stable tag: 4.4.38
Stable tag: 4.4.40
License: MIT License
License URI: https://opensource.org/licenses/MIT

Expand Down
12 changes: 10 additions & 2 deletions templates/tabs/tab-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,22 @@
<?php echo esc_html_x( 'Shrink Helpful Admin Columns', 'label', 'helpful' ); ?>
</label>
</div><!-- .helpful-admin-group -->
<div class="helpful-admin-group">

<div class="helpful-admin-group helpful-margin-bottom">
<label>
<?php $value = get_option( 'helpful_feedback_disabled' ); ?>
<input id="helpful_feedback_disabled" type="checkbox" name="helpful_feedback_disabled" <?php checked( 'on', $value ); ?> />
<?php echo esc_html_x( 'Disable feedback completely.', 'label', 'helpful' ); ?>
</label>
</div><!-- .helpful-admin-group -->

<div class="helpful-admin-group">
<label>
<?php $value = get_option( 'helpful_wordpress_user' ); ?>
<input id="helpful_wordpress_user" type="checkbox" name="helpful_wordpress_user" <?php checked( 'on', $value ); ?> />
<?php echo esc_html_x( 'Use the WordPress user instead of the Helpful ID (if the user is logged in and votes).', 'label', 'helpful' ); ?>
</label>
</div><!-- .helpful-admin-group -->
</div><!-- .helpful-admin-panel-content -->
</div><!-- .helpful-admin-panel -->
<div class="helpful-admin-panel">
Expand Down

0 comments on commit 052c724

Please sign in to comment.