/**
 * Possibly intercept the template being loaded
 *
 * This function does two different things, depending on whether you're using BP
 * 1.7's theme compatibility feature.
 *  - If so, the function runs the 'bp_setup_theme_compat' hook, which tells BP
 *    to run the theme compat layer
 *  - If not, the function checks to see which page you intend to be looking at
 *    and loads the correct top-level bp-docs template
 *
 * The theme compatibility feature kicks in automatically for users running BP
 * 1.7+. If you are running 1.7+, but you do not want theme compat running for
 * a given Docs template type (archive, single, create), you can filter
 * 'bp_docs_do_theme_compat' and return false. This should only be done in the
 * case of legacy templates; if you're customizing new top-level templates for
 * Docs, you may put a file called plugin-buddypress-docs.php into the root of
 * your theme.
 *
 * @since 1.2
 *
 * @param string $template
 *
 * @return string The path to the template file that is being used
 */
function bp_docs_template_include($template = '')
{
    if (!bp_docs_is_docs_component()) {
        return $template;
    }
    $do_theme_compat = bp_docs_do_theme_compat();
    if ($do_theme_compat) {
        do_action('bp_setup_theme_compat');
    } else {
        if (bp_docs_is_single_doc() && ($new_template = bp_docs_locate_template('single-bp_doc.php'))) {
        } elseif (bp_docs_is_doc_create() && ($new_template = bp_docs_locate_template('single-bp_doc.php'))) {
        } elseif (is_post_type_archive(bp_docs_get_post_type_name()) && ($new_template = bp_docs_locate_template('archive-bp_doc.php'))) {
        }
        $template = !empty($new_template) ? $new_template : $template;
    }
    return apply_filters('bp_docs_template_include', $template);
}
Ejemplo n.º 2
0
<?php

$bp_docs_do_theme_compat = is_buddypress() && bp_docs_do_theme_compat('docs-loop.php');
if (!$bp_docs_do_theme_compat) {
    ?>
<div id="buddypress">
<?php 
}
?>

<div class="<?php 
bp_docs_container_class();
?>
">

<?php 
include apply_filters('bp_docs_header_template', bp_docs_locate_template('docs-header.php'));
?>

<?php 
if (current_user_can('bp_docs_manage_folders') && bp_docs_is_folder_manage_view()) {
    ?>
	<?php 
    bp_locate_template('docs/manage-folders.php', true);
} else {
    ?>

	<h2 class="directory-title">
		<?php 
    bp_docs_directory_breadcrumb();
    ?>
Ejemplo n.º 3
0
<?php

$bp_docs_do_theme_compat = is_buddypress() && bp_docs_do_theme_compat('single/edit.php');
if (!$bp_docs_do_theme_compat) {
    ?>
<div id="buddypress">
<?php 
}
?>

<div class="<?php 
bp_docs_container_class();
?>
">
	<?php 
$doc_id = get_the_ID();
?>

	<?php 
include bp_docs_locate_template('single/sidebar.php');
?>

	<?php 
include apply_filters('bp_docs_header_template', bp_docs_locate_template('docs-header.php'));
?>

	<?php 
// No media support at the moment. Want to integrate with something like BP Group Documents
// include_once ABSPATH . '/wp-admin/includes/media.php' ;
if (!function_exists('wp_editor')) {
    require_once ABSPATH . '/wp-admin/includes/post.php';
Ejemplo n.º 4
0
<?php

$bp_docs_do_theme_compat = is_buddypress() && bp_docs_do_theme_compat('single/history.php');
if (!$bp_docs_do_theme_compat) {
    ?>
<div id="buddypress">
<?php 
}
?>

<div class="<?php 
bp_docs_container_class();
?>
">

	<?php 
include apply_filters('bp_docs_header_template', bp_docs_locate_template('docs-header.php'));
?>

	<div class="doc-content">

	<?php 
if (bp_docs_history_is_latest()) {
    ?>

		<p><?php 
    _e("Click on a revision date from the list below to view that revision.", 'bp-docs');
    ?>
</p>

		<p><?php