Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/06/2010 03:18:19 AM (13 years ago)
Author:
johnjamesjacoby
Message:

First pass at user profiles and front-end user editing. Fixes #1364 props GautamGupta via Google Code-in. Split bbp-template.php into smaller files. Rename 'profile-' pages to 'user-'. (This is the Ultra Magnus of changesets.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-themes/bbp-twentyten/functions.php

    r2679 r2688  
    9898
    9999/**
    100  * bbp_twentyten_enqueue_topic_script ()
    101  *
    102  * Enqueue the topic page Javascript file
    103  *
    104  * @package bbPress
    105  * @subpackage bbPress TwentyTen
    106  * @since bbPress (r2652)
    107  *
    108  * @return void
    109  */
    110 function bbp_twentyten_enqueue_topic_script () {
    111     if ( !bbp_is_topic() )
    112         return;
    113 
    114     wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), '20101202' );
    115 }
    116 add_filter( 'wp_enqueue_scripts', 'bbp_twentyten_enqueue_topic_script' );
     100 * bbp_twentyten_enqueue_scripts ()
     101 *
     102 * Enqueue the required Javascript files
     103 *
     104 * @package bbPress
     105 * @subpackage bbPress TwentyTen
     106 * @since bbPress (r2652)
     107 *
     108 * @return void
     109 */
     110function bbp_twentyten_enqueue_scripts () {
     111    if ( bbp_is_topic() )
     112        wp_enqueue_script( 'bbp_topic', get_stylesheet_directory_uri() . '/js/topic.js', array( 'wp-lists' ), '20101202' );
     113
     114    if ( bbp_is_user_profile_edit() )
     115        wp_enqueue_script( 'user-profile' );
     116}
     117add_action( 'wp_enqueue_scripts', 'bbp_twentyten_enqueue_scripts' );
    117118
    118119/**
     
    128129 */
    129130function bbp_twentyten_scripts () {
    130     if ( !bbp_is_topic() )
    131         return; ?>
     131    if ( bbp_is_topic() ) : ?>
    132132
    133133    <script type='text/javascript'>
     
    137137    </script>
    138138
    139 <?php
     139    <?php elseif ( bbp_is_user_profile_edit() ) : ?>
     140
     141    <script type="text/javascript" charset="utf-8">
     142        if ( window.location.hash == '#password' ) {
     143            document.getElementById('pass1').focus();
     144        }
     145    </script>
     146   
     147    <?php
     148    endif;
    140149}
    141150add_filter( 'wp_head', 'bbp_twentyten_scripts', -1 );
Note: See TracChangeset for help on using the changeset viewer.