Management page missing the option to set to ALL comments
-
Hi
When I go to manage subscriptions as a user, I only get the following Action options:
Delete, Suspend, Replies to my comments, ActivateI think one is missing that allows the user to set themselves to receiving All comments.
I had a look in the plugin files and have made some changes that I think have fixed this.
In templates/user.php I replaced:
$action = ! empty( $_POST['sra'] ) ? $_POST['sra'] : ( ! empty( $_GET['sra'] ) ? $_GET['sra'] : '' ); switch ( $action ) { case 'delete': $rows_affected = $wp_subscribe_reloaded->delete_subscriptions( $post_list, $email ); echo '<p class="updated">' . __( 'Subscriptions deleted:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'suspend': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, 'C' ); echo '<p class="updated">' . __( 'Subscriptions suspended:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'activate': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, '-C' ); echo '<p class="updated">' . __( 'Subscriptions activated:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'force_r': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, 'R' ); echo '<p class="updated">' . __( 'Subscriptions updated:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; default: break; }
with this:
$action = ! empty( $_POST['sra'] ) ? $_POST['sra'] : ( ! empty( $_GET['sra'] ) ? $_GET['sra'] : '' ); switch ( $action ) { case 'delete': $rows_affected = $wp_subscribe_reloaded->delete_subscriptions( $post_list, $email ); echo '<p class="updated">' . __( 'Subscriptions deleted:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'suspend': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, 'C' ); echo '<p class="updated">' . __( 'Subscriptions suspended:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'activate': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, '-C' ); echo '<p class="updated">' . __( 'Subscriptions activated:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'force_y': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, 'Y' ); echo '<p class="updated">' . __( 'Subscriptions updated:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; case 'force_r': $rows_affected = $wp_subscribe_reloaded->update_subscription_status( $post_list, $email, 'R' ); echo '<p class="updated">' . __( 'Subscriptions updated:', 'subscribe-reloaded' ) . " $rows_affected</p>"; break; default: break; }
(In other words just added in a line to deal with case ‘force_y’).
Then also in user.php I replaced:
echo '<p id="subscribe-reloaded-action-p">' . __( 'Action:', 'subscribe-reloaded' ) . ' <input type="radio" name="sra" value="delete" id="action_type_delete" /> <label for="action_type_delete">' . __( 'Delete', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="suspend" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">' . __( 'Suspend', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_r" id="action_type_force_y" /> <label for="action_type_force_y">' . __( 'Replies to my comments', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="activate" id="action_type_activate" /> <label for="action_type_activate">' . __( 'Activate', 'subscribe-reloaded' ) . '</label></p>';
with this:
echo '<p id="subscribe-reloaded-action-p">' . __( 'Action:', 'subscribe-reloaded' ) . ' <input type="radio" name="sra" value="delete" id="action_type_delete" /> <label for="action_type_delete">' . __( 'Delete', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="suspend" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">' . __( 'Suspend', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_y" id="action_type_force_y" /> <label for="action_type_force_y">' . __( 'All comments', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_r" id="action_type_force_r" /> <label for="action_type_force_r">' . __( 'Replies to my comments', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="activate" id="action_type_activate" /> <label for="action_type_activate">' . __( 'Activate', 'subscribe-reloaded' ) . '</label></p>';
(In other words just added in the radio for All comments and tidied up the id and label on Replies only.)
Then in templates/author.php I replaced:
echo '<p id="subscribe-reloaded-action-p">' . __( 'Action:', 'subscribe-reloaded' ) . ' <input type="radio" name="sra" value="delete" id="action_type_delete" /> <label for="action_type_delete">' . __( 'Delete', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="suspend" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">' . __( 'Suspend', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_y" id="action_type_force_y" /> <label for="action_type_force_y">' . __( 'Set to Y', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="activate" id="action_type_activate" /> <label for="action_type_activate">' . __( 'Activate', 'subscribe-reloaded' ) . '</label></p>';
with this:
echo '<p id="subscribe-reloaded-action-p">' . __( 'Action:', 'subscribe-reloaded' ) . ' <input type="radio" name="sra" value="delete" id="action_type_delete" /> <label for="action_type_delete">' . __( 'Delete', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="suspend" id="action_type_suspend" checked="checked" /> <label for="action_type_suspend">' . __( 'Suspend', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_y" id="action_type_force_y" /> <label for="action_type_force_y">' . __( 'All comments', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="force_r" id="action_type_force_r" /> <label for="action_type_force_r">' . __( 'Replies to my comments', 'subscribe-reloaded' ) . '</label> <input type="radio" name="sra" value="activate" id="action_type_activate" /> <label for="action_type_activate">' . __( 'Activate', 'subscribe-reloaded' ) . '</label></p>';
(Again, just adding in the All comments radio and tidying up id and label)
Haven’t tested extensively but seems to be working as I think it should.
Cheers
Jonhttps://wordpress.org/plugins/subscribe-to-comments-reloaded/
- The topic ‘Management page missing the option to set to ALL comments’ is closed to new replies.