Title: codejp3's Replies - page 22 | WordPress.org

---

# codejp3

  [  ](https://wordpress.org/support/users/codejp3/)

 *   [Profile](https://wordpress.org/support/users/codejp3/)
 *   [Topics Started](https://wordpress.org/support/users/codejp3/topics/)
 *   [Replies Created](https://wordpress.org/support/users/codejp3/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/codejp3/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/codejp3/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/codejp3/engagements/)
 *   [Favorites](https://wordpress.org/support/users/codejp3/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 316 through 330 (of 407 total)

[←](https://wordpress.org/support/users/codejp3/replies/page/21/?output_format=md)
[1](https://wordpress.org/support/users/codejp3/replies/?output_format=md) [2](https://wordpress.org/support/users/codejp3/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codejp3/replies/page/3/?output_format=md)…
[21](https://wordpress.org/support/users/codejp3/replies/page/21/?output_format=md)
22 [23](https://wordpress.org/support/users/codejp3/replies/page/23/?output_format=md)…
[26](https://wordpress.org/support/users/codejp3/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/codejp3/replies/page/27/?output_format=md)
[28](https://wordpress.org/support/users/codejp3/replies/page/28/?output_format=md)
[→](https://wordpress.org/support/users/codejp3/replies/page/23/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/page/2/#post-16461565)
 * [@robin-w](https://wordpress.org/support/users/robin-w/) – **DONE**
 * [@jb510](https://wordpress.org/support/users/jb510/) & [@kckc](https://wordpress.org/support/users/kckc/)–
   If you’re comfortable raw-editing the plugin files, you can make these changes
   too and “beta test them” before they’re rolled-out in the next plugin release.
 * The approach I listed above seemed like overkill for such a simple task, so I
   walked away for a while and thought about it.
 * It can actually be accomplished using the default bbPress ajax without having
   to deal with any custom JS file generations by just including the expected CSS
   selectors within the button rendering.
 * It’s simplified enough that I don’t have to add a new branch on GitHub. I’m just
   going to post the changes here, you can apply them locally and test them out 
   and roll them out in the next release when you’re happy that it’s working right.
 * **Change #1:**
 * In /includes/functions.php, replace the entire bsp_subscribe_button() function(
   lines 335-356) with:
 *     ```wp-block-code
       // Actually display/render the subscription button
       function bsp_subscribe_button() {
   
       	global $bsp_style_settings_buttons;
   
               // setup the button with custom description if set
               if ( ! empty( $bsp_style_settings_buttons['subscribe_button_description'] ) ) $args['subscribe'] = $bsp_style_settings_buttons['subscribe_button_description'];
               if ( ! empty( $bsp_style_settings_buttons['unsubscribe_button_description'] ) ) $args['unsubscribe'] = $bsp_style_settings_buttons['unsubscribe_button_description'];
   
               // setup remaining required arguments
               $args['user_id'] = bbp_get_user_id( get_current_user_id(), true, true );
               $args['object_id'] = bbp_get_forum_id();
               $args['object_type'] = 'post';
   
               // render the button with arguments
               bbp_user_subscribe_link( $args );
   
       }
   
   
       // Apply filter to the subscription button to make sure the class and descriptions are applied
       function bsp_subscribe_button_filter( $html, $args ) {
   
           global $bsp_style_settings_buttons;
   
           // change "Subscribe" text within the html only if needed
           if ( ! empty( $bsp_style_settings_buttons['subscribe_button_description'] ) ) {
                   if ( $args['subscribe'] !== $bsp_style_settings_buttons['subscribe_button_description'] ) {
                           $html = preg_replace('/'.$args['subscribe'].'/', esc_attr( $bsp_style_settings_buttons['subscribe_button_description'] ), $html);
                   }
           }
   
           // change "Unsubscribe" text within the html only if needed
           if ( ! empty( $bsp_style_settings_buttons['unsubscribe_button_description'] ) ) {
                   if ( $args['unsubscribe'] !== $bsp_style_settings_buttons['unsubscribe_button_description'] ) {
                           $html = preg_replace('/'.$args['unsubscribe'].'/', esc_attr( $bsp_style_settings_buttons['unsubscribe_button_description'] ), $html);
                   }
           }
   
           // setup the class for the link
           if ( $bsp_style_settings_buttons['button_type'] == 2 ) $class = $bsp_style_settings_buttons['Buttonclass'];
           else $class = 'bsp_button1';
   
           // apply the class to the link html
           $pattern = '/class="subscription-toggle"/' ;
           $replace = 'class="subscription-toggle '.$class.'"';
           $html = preg_replace( $pattern, $replace, $html );
   
           // return the customized link html
           return $html;
   
       }
       add_filter( 'bbp_get_user_subscribe_link', 'bsp_subscribe_button_filter', 10, 2 );
       ```
   
 * **Change #2:**
 * At the bottom of /css/styles.php just before the “custom css” generation, add
   this:
 *     ```wp-block-code
       /*----------------------  button fixes to work with default bbPress buttons and override theme values that make buttons look wrong --------------------------*/
   
       /* override bbpress floating subscription link to the right */
       #bbpress-forums div.bsp-center #subscription-toggle {
           float: none;
       }
   
       /* override any theme margins for generic input css so the mark as read button alignment matches */
       input.bsp_button1 {
           margin: 0px;
       }
       ```
   
 * **Change #3 (optional) (fixes the buttons clashing with the notices block):**
 * Also in /css/styles.php on line 3609 replace:
 *     ```wp-block-code
       		.bsp-center
       		{
       			width: 100%;
       			max-width: 100%;
       			float: none;
       			text-align: center;
       			margin-top: 20px;
       		}
       ```
   
 * with:
 *     ```wp-block-code
       		.bsp-center
       		{
       			width: 100%;
       			max-width: 100%;
       			float: none;
       			text-align: center;
       			margin: 10px 0px 10px 0px;
       		}
       ```
   
 * **That’s It!**
 * If you WANT to over-complicate the solution like I was initially doing by trying
   to keep the current bsp button generation method intact, then I have a few hundred
   lines of code spanning across 5 or 6 different files that I can send your way.
   Just seemed like overkill and unnecessary. This approach uses the default bbPress
   html code and ajax, but just applies the custom wording/class to them.
 * I’ve tested with and without BuddyPress active, with multiple themes, and with
   multiple browsers. Good-to-go as far as I can tell. Plus the button now actually
   uses ajax without reloading the page, which is a nice touch! 🙂
    -  This reply was modified 3 years, 4 months ago by [codejp3](https://wordpress.org/support/users/codejp3/).
      Reason: added optional change #3
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/page/2/#post-16461270)
 * [@robin-w](https://wordpress.org/support/users/robin-w/) – I found the fix, but
   it’s quite complicated. Quick overview –
 * 1.) JS needs to be added for the ajax function including custom button class.
   It has to be generated based on custom user class or default bsp_button1 class.
   Also requires the new file to be generated within the main plugin file and within
   admin settings. Only enqueued in /includes/generate_css.php if bsp_style_settings_sub_management[
   subscriptions_management_activate] active. Also has to be multisite friendly.
 * 2.) bsp_subscribe_button() function re-written to use bbp_get_user_subscribe_link()
   which includes ajax action call.
 * This brings up another change that could/should be implemented in /includes/settings.
   php. Within the “$_REQUEST[‘updated’]” success message, include a check for which
   plugin tab is active, and if that plugin tab deals with file generations then
   regenerate the files for only THAT TAB. It looks like most tabs generate files
   individually instead of within the main settings file, and they do so every page
   load instead of only when saved settings have changed.
 * I’m making these changes now and will send you a new pre-pub version to check
   out soon. Just wanted to give you the heads up so that we’re not both tackling
   the same problem.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/#post-16460563)
 * Yeah I tried that too. Then I thought, well maybe it also wants it to be wrapped
   in the span class=subscription-toggle that bbPress uses, but that didn’t work
   either.
 * I think it may take a full rewrite of the current bsp_subscribe_button() function
   in Style Pack /includes/functions.php so that it uses bbp_get_user_subscribe_link()
   instead of bbp_get_forum_subscription_link().
 * Full function details can be found in /bbpress/includes/users/templates.php around
   line 1300-ish:
 *     ```wp-block-code
       bbp_get_user_subscribe_link( $args = array(), $user_id = 0, $wrap = true )
       ```
   
 * args array:
 *     ```wp-block-code
       'subscribe'   => esc_html__( 'Subscribe',   'bbpress' ),
       'unsubscribe' => esc_html__( 'Unsubscribe', 'bbpress' ),
       'user_id'     => 0,
       'object_id'   => 0,
       'object_type' => 'post',
       'before'      => '',
       'after'       => '',
       'redirect_to' => '',
       ```
   
 * minimum required args:
 *     ```wp-block-code
       user_id
       object_id
       object_type
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/#post-16459013)
 * [@kckc](https://wordpress.org/support/users/kckc/) & [@jb510](https://wordpress.org/support/users/jb510/)–
   You’re not crazy! 🙂
 * **Confirmed.** The conflict is not with the private groups plugin, but BuddyPress
   directly.
 * I can replicate the issues with just:
   bbPressBuddyPressStyle Pack
 * Happens in all 3 of my browsers, and regardless of which theme is active.
 * Now to figure out WHY. No client-side errors showing in dev tools and no server-
   side errors showing in the debug log. Probably a conflict with something in BuddyPress
   being named the same thing as something in bbPress/Style Pack.
 * Will keep digging until I find the culprit.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/#post-16457623)
 * I’m going to install BuddyPress and the private groups plugin on my test site.
   Seems like the most likely culprit give both of your feedback so far. I’ll chime
   back in here if I can replicate the issue.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-472/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-472/#post-16453351)
 * [@robin-w](https://wordpress.org/support/users/robin-w/) – If that function for
   subscription management deals with user registration in any way (original critical
   error reason), then it’s certainly a possibility. If not, then I suspect the 
   issue will still exist.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Subscribe to Forum Button not working](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/subscribe-to-forum-button-not-working-2/#post-16453337)
 * I have tested on firefox, chromium, and midori. Also tested against traditional,
   block and fse themes. Subscribe button working fine on all.
 * Only thing I noticed that could use a little tweaking is the margins.
 * The “Mark All Topics Read” button (if enabled), doesn’t have any specific styling
   for it, so it inherits theme-level “input” styling, which some of themes I tested
   against gave it bottom margin of 24px or top margin of 12px or some kind of margin
   value for general input elements, which threw the whole row of buttons off. Adding
   this to /css/styles.php for generation would solve it to override generic input
   element theme styling:
 *     ```wp-block-code
       input.bsp_button1 {
           margin: 0px;
       }
       ```
   
 * And then I noticed that if I display forum notices, the buttons overlap the notice.
 * ![](https://i0.wp.com/wp-singlesite.local-dev.codejp3.com/wp-content/uploads/
   buttons-button-margin.png?ssl=1)
 * Changing the margin values in the .bsp-center class seems to be a good fit.
 * From:
 *     ```wp-block-code
       .bsp-center {
           width: 100%;
           max-width: 100%;
           float: none;
           text-align: center;
           margin-top: 20px;
       }
       ```
   
 * To:
 *     ```wp-block-code
       .bsp-center {
           width: 100%;
           max-width: 100%;
           float: none;
           text-align: center;
           margin: 10px 0px 10px 0px;
       }
       ```
   
 * Like I said, the functionality is working just fine against 3 different themes
   in 3 different browsers so I was not able to replicate the issue. Just noticed
   a few styling tweaks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-472/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-472/#post-16448513)
 * 403 error means “forbidden”
 * Follow the official documentation for how to add that debugging code to wp-config.
   php:
 * > [Debugging in WordPress](https://wordpress.org/documentation/article/debugging-in-wordpress/)
 * Probably related to this:
 * **NOTE**: You must insert this **BEFORE**`/* That's all, stop editing! Happy 
   blogging. */` in the [wp-config.php](https://wordpress.org/support/article/editing-wp-config-php/)
   file.
 * Also, by default
 *     ```wp-block-code
       define( 'WP_DEBUG', false );
       ```
   
 * is already there. You can delete that line or comment it out and then paste the
   code I gave you in the same spot.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-473/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-473/#post-16448161)
 * [@jemar707](https://wordpress.org/support/users/jemar707/) – You’ve got email!
   Let me know if you need any further assistance. 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-472/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-472/#post-16446600)
 * [@kalusha](https://wordpress.org/support/users/kalusha/) – is this the plugin
   you’re using? [WP-Members](https://wordpress.org/plugins/wp-members/)
 * I’ve installed that plugin and played around with it to try to reproduce the 
   error. Everything appears to be working fine with both the default /wp-login.
   php?action=register form and the in-page register form for restricted pages.
 * If you can provide the exact error message to me or [@robin-w](https://wordpress.org/support/users/robin-w/)
   we may be able to make Style Pack work with the WP-Members plugin.
 * Enabling Debugging may help you get the error. You can temporarily enable debugging
   by adding the following lines to your wp-config.php file:
 *     ```wp-block-code
       define( 'WP_DEBUG', true );
   
       // Enable Debug logging to the /wp-content/debug.log file
       define( 'WP_DEBUG_LOG', true );
   
       // Disable display of errors and warnings
       define( 'WP_DEBUG_DISPLAY', true );
       @ini_set( 'display_errors', E_ALL );
   
       define( 'SCRIPT_DEBUG', true );
       ```
   
 * And for better control over debug messages, I recommend this plugin – [DebugPress](https://wordpress.org/plugins/debugpress/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-473/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-473/#post-16446548)
 * [@jemar707](https://wordpress.org/support/users/jemar707/) – I’ve tried very 
   hard to replicate your error with full debugging enabled and have not been able
   to reproduce it yet.
 * I’ve tried the specific steps you listed to recreate:
   Activate Moderation Tools
   in bbp style pack, create a new topic or reply in the forum.I tried with various
   Moderation tools settings in wp-admin/options-general.php?page=bbpress
 * I tried by creating topics as an admin user, a regular user, and a guest user.
 * I tried those on 3 different theme types (traditional (twenty-ten), block (twenty-
   twenty-two), and full-site editing (twenty-twenty-three) ).
 * **NOTHING**. No critical errors. I’m not even getting any general PHP warning/
   notice messages. It seems to be working exactly as expected without any issues.
 * Since I cannot replicate it, I’d like for you to share your exact setting values
   for Style Pack. Here’s what I’m requesting you email to me (and [@robin-w](https://wordpress.org/support/users/robin-w/)):
 * 
   **1.) **Your Style Pack Settings ( export them as a file and attach it to the
   email: wp-admin/options-general.php?page=bbp-style-pack&tab=export )
 * 
   **2.) **The Plugin Information at the top of the “Plugin Information” tab ( 
   wp-admin/options-general.php?page=bbp-style-pack&tab=plugin-info ), specifically
   the first 6 values (WP Version – Active Plugins).
 * **3.)** The exact error message you received in your email (if any) when the 
   critical error occurs.
 * Please email them to [codejp3@gmail.com](https://wordpress.org/support/users/codejp3/replies/page/22/codejp3@gmail.com?output_format=md)
   and to the address that [@robin-w](https://wordpress.org/support/users/robin-w/)
   [provided above](http://www.rewweb.co.uk/contact-me/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] Critical Error](https://wordpress.org/support/topic/critical-error-473/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/critical-error-473/#post-16446221)
 * [@robin-w](https://wordpress.org/support/users/robin-w/) Guess I’ll start testing
   these two critical error bugs too.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] with 5.2.6 all widgets are out](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/#post-16446156)
 * [@robin-w](https://wordpress.org/support/users/robin-w/) good to know, but I’m
   still going to test widgets and shortcodes thoroughly today. If there are any
   lingering issues, I want them wrapped-up. If there are no issues, then perhaps
   I can help [@litzelmann](https://wordpress.org/support/users/litzelmann/) figure
   out why they’re having issues on their specific server/site.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] with 5.2.6 all widgets are out](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/#post-16446100)
 * OK. I’m on it. Should have a fix for you later today.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[bbp style pack] with 5.2.6 all widgets are out](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/)
 *  [codejp3](https://wordpress.org/support/users/codejp3/)
 * (@codejp3)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/with-5-2-6-all-widgets-are-out/#post-16445995)
 * [@litzelmann](https://wordpress.org/support/users/litzelmann/)
 * No. They have been applied to the past 3 updates so there’s nothing for you to
   do at this point.
 * I’m digging into widgets and shortcodes now. Question:
 * Are you still having issues with specific widgets/shortcodes, or all of them?

Viewing 15 replies - 316 through 330 (of 407 total)

[←](https://wordpress.org/support/users/codejp3/replies/page/21/?output_format=md)
[1](https://wordpress.org/support/users/codejp3/replies/?output_format=md) [2](https://wordpress.org/support/users/codejp3/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/codejp3/replies/page/3/?output_format=md)…
[21](https://wordpress.org/support/users/codejp3/replies/page/21/?output_format=md)
22 [23](https://wordpress.org/support/users/codejp3/replies/page/23/?output_format=md)…
[26](https://wordpress.org/support/users/codejp3/replies/page/26/?output_format=md)
[27](https://wordpress.org/support/users/codejp3/replies/page/27/?output_format=md)
[28](https://wordpress.org/support/users/codejp3/replies/page/28/?output_format=md)
[→](https://wordpress.org/support/users/codejp3/replies/page/23/?output_format=md)