/** * 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; }
/** * 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; }
/** * Echoes the output of bp_docs_get_delete_doc_link() * * @package BuddyPress Docs * @since 1.0.1 */ function bp_docs_delete_doc_link() { echo bp_docs_get_delete_doc_link(); }