Пример #1
0
/**
 * Returns the reply link.
 *
 * @since  1.0.0
 * @access public
 * @param  int     $reply_id
 * @return string
 */
function mb_get_reply_link($reply_id = 0)
{
    $url = mb_get_reply_url($reply_id);
    $title = mb_get_reply_title($reply_id);
    return apply_filters('mb_get_reply_link', sprintf('<a class="mb-reply-link" href="%s">%s</a>', $url, $title), $reply_id);
}
Пример #2
0
function mb_get_edit_page_title()
{
    $title = '';
    if (mb_is_forum_edit()) {
        $title = sprintf(mb_get_forum_label('mb_form_edit_item'), mb_get_forum_title());
    } elseif (mb_is_topic_edit()) {
        $title = sprintf(mb_get_topic_label('mb_form_edit_item'), mb_get_topic_title());
    } elseif (mb_is_reply_edit()) {
        $title = sprintf(mb_get_reply_label('mb_form_edit_item'), mb_get_reply_title());
    } elseif (mb_is_user_edit()) {
        $title = __('Edit User', 'message-board');
    }
    return apply_filters('mb_get_edit_title', $title);
}
Пример #3
0
 /**
  * Displays admin notices for the edit forum screen.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public function admin_notices()
 {
     $allowed_notices = array('restore', mb_get_spam_post_status());
     if (isset($_GET['mb_reply_notice']) && in_array($_GET['mb_reply_notice'], $allowed_notices) && isset($_GET['reply_id'])) {
         $notice = $_GET['mb_reply_notice'];
         $reply_id = mb_get_reply_id(absint($_GET['reply_id']));
         if (mb_get_spam_post_status() === $notice) {
             $text = sprintf(__('The reply "%s" was successfully marked as spam.', 'message-board'), mb_get_reply_title($reply_id));
         } elseif ('restore' === $notice) {
             $text = sprintf(__('The reply "%s" was successfully removed from spam.', 'message-board'), mb_get_reply_title($reply_id));
         }
         if (!empty($text)) {
             printf('<div class="updated"><p>%s</p></div>', $text);
         }
     }
 }