<?php 
do_action('bp_docs_before_doc_header_content');
?>

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

	<div id="bp-docs-single-doc-header">
		<?php 
    if (!bp_docs_is_theme_compat_active()) {
        ?>
			<h2 class="doc-title"><?php 
        bp_docs_the_breadcrumb();
        if (bp_docs_is_doc_trashed()) {
            ?>
 <span class="bp-docs-trashed-doc-notice" title="<?php 
            esc_html_e('This Doc is in the Trash', 'bp-docs');
            ?>
">Trash</span><?php 
        }
        ?>
</h2>
		<?php 
    }
    ?>

		<?php 
    do_action('bp_docs_single_doc_header_fields');
    ?>
Exemple #2
0
 /**
  * Add a bp-docs class to bp-docs pages
  *
  * @since 1.3
  */
 function body_class($classes)
 {
     if (bp_docs_is_docs_component()) {
         $classes[] = 'bp-docs';
     }
     if (bp_docs_is_doc_trashed()) {
         $classes[] = 'trashed-doc';
     }
     if (wp_is_mobile()) {
         $classes[] = 'mobile';
     }
     if (bp_docs_is_doc_edit()) {
         $classes[] = 'bp-docs-edit';
     }
     return array_unique($classes);
 }
/**
 * Get HTML for the Delete/Untrash link used on single Doc pages.
 *
 * @since 1.5.5
 *
 * @param int $doc_id Optional. Default: ID of current Doc.
 * @return string HTML of Delete/Remove from Trash link.
 */
function bp_docs_get_delete_doc_button($doc_id = false)
{
    if (!$doc_id) {
        $doc_id = bp_docs_is_existing_doc() ? get_queried_object_id() : get_the_ID();
    }
    if (bp_docs_is_doc_trashed($doc_id)) {
        $button = '<a class="delete-doc-button untrash-doc-button confirm" href="' . bp_docs_get_remove_from_trash_link($doc_id) . '">' . __('Remove from Trash', 'bp-docs') . '</a>';
    } else {
        $button = '<a class="delete-doc-button confirm" href="' . bp_docs_get_delete_doc_link() . '">' . __('Delete', 'bp-docs') . '</a>';
    }
    return $button;
}
/**
 * Get HTML for the Delete/Untrash link used on single Doc pages.
 *
 * @since 1.5.5
 *
 * @param int $doc_id Optional. Default: ID of current Doc.
 * @return string HTML of Delete/Remove from Trash link.
 */
function bp_docs_get_delete_doc_button($doc_id = false)
{
    if (!$doc_id) {
        $doc_id = bp_docs_is_existing_doc() ? get_queried_object_id() : get_the_ID();
    }
    if (bp_docs_is_doc_trashed($doc_id)) {
        // A button to remove the doc from the trash...
        $button = ' <a class="delete-doc-button untrash-doc-button confirm" href="' . bp_docs_get_remove_from_trash_link($doc_id) . '">' . __('Remove from Trash', 'bp-docs') . '</a>';
        // and a button to permanently delete the doc.
        $button .= '<a class="delete-doc-button confirm" href="' . bp_docs_get_delete_doc_link() . '">' . __('Permanently Delete', 'bp-docs') . '</a>';
    } else {
        // A button to move the doc to the trash...
        $button = '<a class="delete-doc-button confirm" href="' . bp_docs_get_delete_doc_link() . '">' . __('Move to Trash', 'bp-docs') . '</a>';
        // and a button to permanently delete the doc.
        $button .= '<a class="delete-doc-button confirm" href="' . bp_docs_get_delete_doc_link(true) . '">' . __('Permanently Delete', 'bp-docs') . '</a>';
    }
    return $button;
}