Conversation
supportI tried to add a the function get_image_credits(); on a post, but I got this message: Fatal error: Call to undefined function get_image_credits() in /…/wp-content/themes/…/content-meta.php on line 9 Later I tried do_shortcode('[image-credits]') and it worked, but I got this error message as well: Warning: Wrong parameter count for in_array() in /…/wp-content/plugins/image-credits/plugin.php on line 137 Does anyone have an idea to fix this? http://wordpress.org/extend/plugins/image-credits/
I’m still lost with this problem. Does anyone else experience the same problems?
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
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 ) ) {
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.
I’m still lost with this problem. Does anyone else experience the same problems?
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
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 ) ) {
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.