Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2011 08:31:10 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Adjust internal action load orders to stop 'doing it wrong' by moving appropriate actions off plugins_loaded and into init. Fixes #2609 but will need testing; it may have adverse effects on external plugins. Adds missing function_exists checks to bp-default functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/functions.php

    r3736 r3742  
    117117endif;
    118118
    119 /**
    120  * Enqueue theme javascript safely after the 'init' action, per WordPress Codex.
     119if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :
     120/**
     121 * Enqueue theme javascript safely
    121122 *
    122123 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
     
    146147}
    147148add_action( 'wp_enqueue_scripts', 'bp_dtheme_enqueue_scripts' );
     149endif;
    148150
    149151if ( !function_exists( 'bp_dtheme_admin_header_style' ) ) :
     
    289291endif;
    290292
     293if ( !function_exists( 'bp_dtheme_widgets_init' ) ) :
    291294/**
    292295 * Register widgetised areas, including one sidebar and four widget-ready columns in the footer.
     
    355358}
    356359add_action( 'widgets_init', 'bp_dtheme_widgets_init' );
     360endif;
    357361
    358362if ( !function_exists( 'bp_dtheme_blog_comments' ) ) :
     
    425429endif;
    426430
     431if ( !function_exists( 'bp_dtheme_page_on_front' ) ) :
    427432/**
    428433 * Return the ID of a page set as the home page.
     
    437442    return apply_filters( 'bp_dtheme_page_on_front', get_option( 'page_on_front' ) );
    438443}
    439 
     444endif;
     445
     446if ( !function_exists( 'bp_dtheme_activity_secondary_avatars' ) ) :
    440447/**
    441448 * Add secondary avatar image to this activity stream's record, if supported.
     
    463470}
    464471add_filter( 'bp_get_activity_action_pre_meta', 'bp_dtheme_activity_secondary_avatars', 10, 2 );
    465 
     472endif;
     473
     474if ( !function_exists( 'bp_dtheme_show_notice' ) ) :
    466475/**
    467476 * Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html)
     
    479488if ( is_admin() && isset($_GET['activated'] ) && $pagenow == "themes.php" )
    480489    add_action( 'admin_notices', 'bp_dtheme_show_notice' );
     490endif;
    481491
    482492if ( !function_exists( 'bp_dtheme_main_nav' ) ) :
     
    516526endif;
    517527
     528if ( !function_exists( 'bp_dtheme_page_menu_args' ) ) :
    518529/**
    519530 * Get our wp_nav_menu() fallback, bp_dtheme_main_nav(), to show a home link.
     
    528539}
    529540add_filter( 'wp_page_menu_args', 'bp_dtheme_page_menu_args' );
    530 
     541endif;
     542
     543if ( !function_exists( 'bp_dtheme_comment_form' ) ) :
    531544/**
    532545 * Applies BuddyPress customisations to the post comment form.
     
    564577}
    565578add_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );
    566 
     579endif;
     580
     581if ( !function_exists( 'bp_dtheme_before_comment_form' ) ) :
    567582/**
    568583 * Adds the user's avatar before the comment form box.
     
    592607}
    593608add_action( 'comment_form_top', 'bp_dtheme_before_comment_form' );
    594 
     609endif;
     610
     611if ( !function_exists( 'bp_dtheme_after_comment_form' ) ) :
    595612/**
    596613 * Closes tags opened in bp_dtheme_before_comment_form().
     
    602619function bp_dtheme_after_comment_form() {
    603620?>
     621
    604622    </div><!-- .comment-content standard-form -->
     623
    605624<?php
    606625}
    607626add_action( 'comment_form', 'bp_dtheme_after_comment_form' );
    608 
     627endif;
    609628
    610629// Everything beyond this point is deprecated as of BuddyPress 1.3. This will be removed in a future version.
     630
     631if ( BP_VERSION < 1.3 ) :
    611632
    612633/**
     
    701722        wp_enqueue_script( 'comment-reply' );
    702723}
     724endif;
     725
    703726?>
Note: See TracChangeset for help on using the changeset viewer.