Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
- // Register buttons for the relevant component templates
- // Friends button
- if ( bp_is_active( 'friends' ) )
- add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 );
- // Activity button
- if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() )
- add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 );
- // Messages button
- if ( bp_is_active( 'messages' ) )
- add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 );
- // Group buttons
- if ( bp_is_active( 'groups' ) ) {
- add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 );
- add_action( 'bp_directory_groups_actions', 'bp_group_join_button' );
- }
- // Blog button
- if ( bp_is_active( 'blogs' ) )
- add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' );
- }
- }
- add_action( 'after_setup_theme', 'bp_dtheme_setup' );
- endif;
- if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :
- /**
- * Enqueue theme javascript safely
- *
- * @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script
- * @since BuddyPress (1.5)
- */
- function bp_dtheme_enqueue_scripts() {
- // Enqueue the global JS - Ajax will not work without it
- wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ), bp_get_version() );
- // Add words that we need to use in JS to the end of the page so they can be translated and still used.
- $params = array(
- 'my_favs' => __( 'My Favorites', 'buddypress' ),
- 'accepted' => __( 'Accepted', 'buddypress' ),
- 'rejected' => __( 'Rejected', 'buddypress' ),
- 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ),
- 'show_x_comments' => __( 'Show all %d comments', 'buddypress' ),
- 'show_all' => __( 'Show all', 'buddypress' ),
- 'comments' => __( 'comments', 'buddypress' ),
- 'close' => __( 'Close', 'buddypress' ),
- 'view' => __( 'View', 'buddypress' ),
- 'mark_as_fav' => __( 'Favorite', 'buddypress' ),
- 'remove_fav' => __( 'Remove Favorite', 'buddypress' ),
- 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
- );
- wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );
- // Maybe enqueue comment reply JS
- if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) )
- wp_enqueue_script( 'comment-reply' );
- }
- add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_scripts' );
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement