Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Does BuddyPress 2.4.0 – Pietro take advantage of php 7

@mcpeanut

Participant

Talking about JavaScript @henrywright, without going off topic or meaning to hijack this thread I have a question for you that you may be able to help me with that’s driving me nuts, you know how we spoke ages ago about combining js scripts etc? well I have a problem on my members pages that is frustrating me, I have all my js files combined how I need them to be and working great on every single page of the website and have all js moved to the bottom instead of being at the top with the use of a plugin.

Now the problem I have is on a users member/profile pages, on these pages 2 of my js files remain at the top which is causing me problems with another plugin I use on these pages, the plugins all work fine but makes the pages briefly flash when switching tabs, i have narrowed it down to these js files loading in the head that are causing the problem. The plugin I use to move the js to the bottom only supports pages and posts and not custom post types (so it works fine on the activity/members/groups main pages but not in the individual groups or personal members pages), now I have got the code to add the custom post types so that it can move the js to the bottom on the members profile pages but I am not sure what custom post types these pages use?

The code I need to use is below, but what custom post type should I add for the buddypress personal members pages to be included any ideas?

function stf_add_cpt_support( $post_types ) {
    $post_types[] = 'project';
    
    return $post_types;
}
add_filter( 'scripts_to_footer_post_types', 'stf_add_cpt_support' );

sorry @rosyteddy but i only brought it up as henry mentioned JS 🙂

Skip to toolbar