get_question_id()
Description #
Get current question ID in single question page.
Source #
File: includes/functions.php
function get_question_id() {
if ( is_question() && get_query_var( 'question_id' ) ) {
return (int) get_query_var( 'question_id' );
}
if ( is_question() ) {
return (int) get_queried_object_id();
}
if ( get_query_var( 'edit_q' ) ) {
return (int) get_query_var( 'edit_q' );
}
if ( ap_answer_the_object() ) {
return (int) ap_get_post_field( 'post_parent' );
}
return 0;
}
Expand full source code Collapse full source code View on GitHub: includes/functions.php:209
Add your comment