multiple database call
multiple getProjectPost() run, shouldnt this be called once for the database or put into cache?
pls improve your code. it's calling the database multiple times.
public function getProjectPost() {
global $wpdb;
$row = $wpdb->get_results(
$wpdb->prepare( "SELECT * FROM {$wpdb->posts} p
WHERE p.post_type = %s and p.post_status='publish'
ORDER BY ID DESC LIMIT 1 ", Brizy_Editor_Project::BRIZY_PROJECT ),
OBJECT
);
$projectPost = null;
if ( isset( $row[0] ) ) {
return $row[0];
}
return null;
}
0
-
Hi,
Thank you for your message. We already send it to our team and we will investigate this.
Let us know if we can help you with something else.Best regards,
Sandra0
Please sign in to leave a comment.
Comments
1 comment