Пример #1
0
/**
 * Ticket Form Shortcode
 *
 * Displays the ticket submission form
 *
 * @since	1.0
 * @param	arr		$atts		Shortcode attributes
 * @return	str
 */
function kbs_submit_form_shortcode($atts)
{
    if (kbs_user_must_be_logged_in() && !is_user_logged_in()) {
        return kbs_login_form(kbs_get_current_page_url());
    }
    extract(shortcode_atts(array('form' => 0), $atts, 'kbs_submit'));
    return kbs_display_form($form);
}
Пример #2
0
/**
 * When a user is trying to view restricted content.
 *
 * @since	1.0
 * @return	str		Message displayed when content is restricted
 */
function kbs_article_restricted_content_action($post = null)
{
    global $post;
    if (is_archive()) {
        $content = apply_filters('kbs_restrict_kb_article_archive_message', __('This content is restricted', 'kb-support'));
    } else {
        $content = apply_filters('kbs_restrict_kb_article_single_message', kbs_login_form());
    }
    return $content;
}