Thread Starter
paer
(@paer)
I’m still lost with this problem. Does anyone else experience the same problems?
Thread Starter
paer
(@paer)
I found a simple solution, but only works by using do_shortcode:
<?php echo do_shortcode('[image-credits]') ?>
Just exclude “in_array” On line 137 of file plugin.php. See example:
if ( !empty( $source_name ) && !empty( $source_url ) /*&& !in_array( $source_url, $source_urls )*/ ) {
Until now, I haven’t discovered any bugs yet. Fingers crossed 😉
I have this problem too:
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\testsite\wp-content\plugins\image-credits\plugin.php on line 137
Thread Starter
paer
(@paer)
Did u comment this out yet?
/*&& !in_array( $source_url, $source_urls )*/
No because I needed the shortcode and not put inside the theme. But I just tried it (deleted, not commented out) and it works with the shortcode too! Thanks!
This warning is very simple to fix
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\testsite\wp-content\plugins\image-credits\plugin.php on line 137
At the line 137 add just this :
$source_urls = array();
Before that :
if ( !empty( $source_name ) && !empty( $source_url ) && !in_array( $source_url, $source_urls ) ) {
Thread Starter
paer
(@paer)
Thank you, this fix did it.
But after fixing the issue on line 137, I had the same issue on line 117, too.
So I added this:
$attachment_ids = array();
Before that:
if ( in_array( $id, $attachment_ids ) )
I applied your code but now only one image credit shows up in a post where there is more than one image that has credits.
This array error will be fixed in an update to the plugin I’m uploading later today.