Пример #1
0
/**
 * Echo active answer question id
 * @return void
 * @since 2.1
 */
function ap_answer_the_question_id()
{
    echo ap_answer_get_the_question_id();
}
Пример #2
0
function get_question_id()
{
    if (is_question() && get_query_var('question_id')) {
        return (int) get_query_var('question_id');
    } elseif (is_question() && get_query_var('question')) {
        return get_query_var('question');
    } elseif (is_question() && get_query_var('question_name')) {
        $post = get_page_by_path(get_query_var('question_name'), OBJECT, 'question');
        return $post->ID;
    } elseif (get_query_var('edit_q')) {
        return get_query_var('edit_q');
    } elseif (ap_answer_the_object()) {
        return ap_answer_get_the_question_id();
    }
    return false;
}