WPIntell

Source evidence

Error on function or do_shortcode

Image Credits · support · 2013-06-07T13:10:00+00:00

mixedsentiment
highseverity
0.82relevance
9replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 29 rows with source links

20.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

23 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
paer resolved
I 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.

Comments

9 shown
paer 2013-06-25T22:33:00+00:00

I’m still lost with this problem. Does anyone else experience the same problems?

paer 2013-07-04T17:16:00+00:00

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 😉

thatwastaxing 2013-07-17T17:47:00+00:00

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

paer 2013-07-17T18:30:00+00:00

Did u comment this out yet? /*&& !in_array( $source_url, $source_urls )*/

thatwastaxing 2013-07-17T19:08:00+00:00

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!

jeremy9856 2013-08-23T17:08:00+00:00

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 ) ) {

paer 2013-08-24T16:52:00+00:00

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 ) )

thatwastaxing 2013-09-11T11:06:00+00:00

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.

Adam Capriola 2013-09-11T19:51:00+00:00

This array error will be fixed in an update to the plugin I’m uploading later today.