ap_questions_answer_ids( integer $question_id )

Description #

Get the IDs of answer by question ID.

Parameters #

  • $question_id
    integer (Required) Question post ID.

Changelog #

VersionDescription
2.4Introduced.

Source #

File: includes/functions.php

function ap_questions_answer_ids( $question_id ) {
	global $wpdb;

	$ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = 'answer' AND post_parent=%d", $question_id ) ); // phpcs:ignore WordPress.DB

	return $ids;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment