{"id":18185715,"date":"2024-12-08T14:47:35","date_gmt":"2024-12-08T14:47:35","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/mark-all-topics-as-read-button-feedback\/"},"modified":"2024-12-08T15:06:16","modified_gmt":"2024-12-08T15:06:16","slug":"mark-all-topics-as-read-button-feedback","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/mark-all-topics-as-read-button-feedback\/","title":{"rendered":"Report a bug about &#8220;Mark all topics as read&#8221; button"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First of all, this plugin is great and very useful. Thank you for your work!<br \/>I would like to report a bug.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <strong>Unread Posts<\/strong> tab, for the 6th option, <em><strong>Opt-in or Opt-out options<\/strong><\/em>, I selected the <strong><em>Allow users to opt-in<\/em> option<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, I noticed that the <em>&#8220;Mark all topics as read&#8221;<\/em> button still appears on the page for users who have not chosen to enable the <em>&#8220;Display unread icons&#8221;<\/em> feature or for users who are not logged in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I believe this is a bug because this button is meaningless for those users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I also saw that the code for this feature is no longer maintained, but I would really appreciate it if you could fix this bug. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I tried custom the function code but it didn&#8217;t work&#8230;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function bsp_add_unread_actions () {<br \/><br \/>\u00a0 \u00a0 global $bsp_style_settings_unread ;<br \/><br \/>\u00a0 \u00a0 if (!is_user_logged_in()) return;<br \/><br \/>\u00a0 \u00a0 $user = wp_get_current_user();<br \/><br \/>\u00a0 \u00a0 $user_id = $user-&gt;ID;<br \/><br \/>\u00a0 \u00a0 $optinout = (!empty(get_user_meta($user_id, 'bsp_unread_optinout', true)) ? get_user_meta($user_id, 'bsp_unread_optinout', true) : '');<br \/><br \/>\u00a0 \u00a0 $show_unread = false;<br \/><br \/>\u00a0 \u00a0 if ($bsp_style_settings_unread&#091;'optinout'] == 1) {<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 $show_unread = true;<br \/><br \/>\u00a0 \u00a0 }<br \/><br \/>\u00a0 \u00a0 elseif ($bsp_style_settings_unread&#091;'optinout'] == 2 &amp;&amp; $optinout == 1) {<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 $show_unread = true;<br \/><br \/>\u00a0 \u00a0 }<br \/><br \/>\u00a0 \u00a0 elseif ($bsp_style_settings_unread&#091;'optinout'] == 3 &amp;&amp; $optinout != 2) {<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 $show_unread = true;<br \/><br \/>\u00a0 \u00a0 }<br \/><br \/>\u00a0 \u00a0 if ($show_unread) {<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 add_action(\"bbp_theme_before_topic_title\", \"bsp_ur_icon_wrapper_begin\");<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 add_action(\"bbp_template_after_single_topic\", \"bsp_ur_on_topic_visit\");<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 add_action('bbp_theme_before_forum_title', 'bsp_unread_forum_icons');<br \/><br \/>\u00a0 \u00a0 \u00a0 \u00a0 add_action('bbp_template_before_single_forum', 'bsp_test_mark_as_read');<br \/><br \/>\u00a0 \u00a0 }<br \/><br \/>}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-18185715","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18185715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18185715\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18185715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}