Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/17/2022 06:36:20 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Theme Compat: improve "no-js" body class swapping.

This change introduces a new helper function (bbp_swap_no_js_body_class()) which is used to output the <script> tag that was previously inside of the single template part that needed it.

It also adds a prefix (bbp) to those "no-js" body classes, with the intention of avoiding conflicts with other plugins & themes that may also be using the no-js body class for their own purposes.

Props dd32, r-a-y.

In branches/2.6 for 2.6.10. Fixes #3445.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/core/actions.php

    r7087 r7230  
    130130add_action( 'bbp_init', 'bbp_topic_content_autoembed', 8 );
    131131
     132// <body> class swap from "bbp-no-js" to "bbp-js"
     133add_action( 'wp_body_open', 'bbp_swap_no_js_body_class' );
     134add_action( 'bbp_footer',   'bbp_swap_no_js_body_class' );
     135
    132136/**
    133137 * bbp_ready - attached to end 'bbp_init' above
     
    138142 */
    139143add_action( 'bbp_ready',  'bbp_setup_akismet',    2  ); // Spam prevention for topics and replies
     144
     145// Setup BuddyPress using its own hook
    140146add_action( 'bp_include', 'bbp_setup_buddypress', 10 ); // Social network integration
    141147
Note: See TracChangeset for help on using the changeset viewer.