Bug report: frontend.php:318
Author | Posts |
---|---|
June 24, 2015 at 7:37 am 52910 | |
towhid | Hello, There is a bug in the loop. The $projects variable is an Array with WP_Post Objects listed by numerical indexes, but the last item of the Array is a key=>value item: [total_projects] => N On the front-end, the output generate a last "project" that is in fact a link to the current page. I suggest checking if current item of the loop is A) an object and B) is a WP_Post object. Else continue. `if ( !$project_obj->has_permission( $project ) || !is_object( $project ) || !is_a( $project, 'WP_Post' ) ) { continue; }` Please advise. Thank you |
June 30, 2015 at 4:09 pm 53768 | |
towhid | Hello Charles, Sorry for my late reply. I am really sorry to say that I did not understand your question. Can you please clear the question more. Thanks |
June 30, 2015 at 5:33 pm 53782 | |
Charles | Hello again, I am not asking a question. I am stating that there is error in you code, I am explaining to you what it is, and I am giving you a way to repair it. I am a senior WordPress developper. File: frontend.php, near line 318 The $projects variable is an Array with WP_Post Objects listed by numerical indexes, but the last item of the Array is a key=>value item: RESULT: On the front-end, the output generate a last “project” that is in fact a link to the current page. You need either to check in the loop if the current item is a WP_Post Object or rebuild the output of the CPM_Project->get_projects to store all the WP_Post Objects inside a single sub array. |
July 1, 2015 at 3:11 pm 53902 | |
towhid | Hello Charles, Thank you very much for pointing out the code error to us. I will discuss to our developer team about the error. 🙂 |