Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/05/2016 04:08:04 AM (10 years ago)
Author:
boonebgorges
Message:

Move bp-blogs classes to their own files.

See #6870.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/classes/class-bp-blogs-theme-compat.php

    r10515 r10517  
    11<?php
    22/**
    3  * BuddyPress Blogs Screens.
     3 * BuddyPress Blogs Theme Compatibility.
    44 *
    55 * @package BuddyPress
     
    1010// Exit if accessed directly.
    1111defined( 'ABSPATH' ) || exit;
    12 
    13 /**
    14  * Load the "My Blogs" screen.
    15  */
    16 function bp_blogs_screen_my_blogs() {
    17     if ( !is_multisite() )
    18         return false;
    19 
    20     /**
    21      * Fires right before the loading of the My Blogs screen template file.
    22      *
    23      * @since 1.0.0
    24      */
    25     do_action( 'bp_blogs_screen_my_blogs' );
    26 
    27     bp_core_load_template( apply_filters( 'bp_blogs_template_my_blogs', 'members/single/home' ) );
    28 }
    29 
    30 /**
    31  * Load the "Create a Blog" screen.
    32  */
    33 function bp_blogs_screen_create_a_blog() {
    34 
    35     if ( !is_multisite() ||  !bp_is_blogs_component() || !bp_is_current_action( 'create' ) )
    36         return false;
    37 
    38     if ( !is_user_logged_in() || !bp_blog_signup_enabled() )
    39         return false;
    40 
    41     /**
    42      * Fires right before the loading of the Create A Blog screen template file.
    43      *
    44      * @since 1.0.0
    45      */
    46     do_action( 'bp_blogs_screen_create_a_blog' );
    47 
    48     bp_core_load_template( apply_filters( 'bp_blogs_template_create_a_blog', 'blogs/create' ) );
    49 }
    50 add_action( 'bp_screens', 'bp_blogs_screen_create_a_blog', 3 );
    51 
    52 /**
    53  * Load the top-level Blogs directory.
    54  */
    55 function bp_blogs_screen_index() {
    56     if ( bp_is_blogs_directory() ) {
    57         bp_update_is_directory( true, 'blogs' );
    58 
    59         /**
    60          * Fires right before the loading of the top-level Blogs screen template file.
    61          *
    62          * @since 1.0.0
    63          */
    64         do_action( 'bp_blogs_screen_index' );
    65 
    66         bp_core_load_template( apply_filters( 'bp_blogs_screen_index', 'blogs/index' ) );
    67     }
    68 }
    69 add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
    70 
    71 /** Theme Compatibility *******************************************************/
    7212
    7313/**
     
    260200    }
    261201}
    262 new BP_Blogs_Theme_Compat();
Note: See TracChangeset for help on using the changeset viewer.