<?php
if ( ! function_exists( 'wpj_get_requests_by_title_or_content' ) ) {
	function wpj_get_requests_by_title_or_content( $keyword ) {
		global $wpdb;

		return $wpdb->get_results(
			"
			SELECT ID, post_title, post_content
			FROM {$wpdb->prefix}posts
			WHERE ( ( post_title LIKE '%" . $keyword . "%' )
					OR ( post_content LIKE '%" . $keyword . "%' ) )
				AND post_type = 'request'
				AND post_status = 'publish'
			ORDER BY post_title ASC
			LIMIT 6
			"
		);
	}
}