2 bugs in the example
-
Hi,
As a WP and php beginner it took me a while to uncover these bugs in your sample code:
1.
'posts_per_page' => 5misses the comma at the end
2. don’t ask me why but rpt_get_object_relation() returns boolean 1 when there are no related posts. That makes this line (and more down the line) fail because it passes the check when it shouldn’t:
if ( count($related_pages_ids) >= 1 ) {I fixed it by changing it to:
if ( is_array($related_works_ids) ) {Hope this saves someone a couple of hours of hair pulling!
Best, Dieter
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘2 bugs in the example’ is closed to new replies.