Bugs in code throwing PHP warnings
-
Due to the way some of your code is written, there are instances where a PHP Warning is being thrown…
In your
getAttachmentStruct
method you’re returning either WP_Error or array, but when you make that call, you’re calling it directly inside of anarray_merge
call … you should be checking if it’s a WP_Error object before trying to merge it into an array// attachments $attachment_content =array(); foreach($attachments as $attachment){ $attachment_content = array_merge($attachment_content, self::getAttachmentStruct($attachment)); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bugs in code throwing PHP warnings’ is closed to new replies.