Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9078

    pgerrity
    Participant

    With PHP 7.2, this warning appears with the Intense Shortcodes plugin:

    Warning: count(): Parameter must be an array or an object that implements Countable in C:\xampp\_clients\flexo-academy\wp-content\plugins\intense\shortcodes\overlay\overlay-shortcode.php on line 44.

    Updating the code as follows should correct this.

    Current code (starting line 42):
    if ( !empty( $image ) ) {
    $alt = get_post_meta( $image, ‘_wp_attachment_image_alt’, true );
    if (is_array($alt)==FALSE){
    $alt=[];
    }
    }

    Suggested Correction:
    if ( !empty( $image ) ) {
    $alt = get_post_meta( $image, ‘_wp_attachment_image_alt’, true );
    if (is_array($alt)==FALSE){
    $alt=[];
    }
    if ( count( $alt ) ) {
    $atts[‘alt’] = $alt;
    }
    }

    We love this plugin!

    #9086

    Intense Visions
    Keymaster

    Thanks for reporting the issue and proposing a fix. You are awesome! This ended up being the fix:

    if (!empty($image)) {
        $alt = get_post_meta($image, '_wp_attachment_image_alt', true);
    			
        if (! empty($alt)) {
            $atts['alt'] = $alt;
        }
    }
    

    The change will also be in the next release.

    #12342

    pgerrity
    Participant

    What is the version number this was (or will be) fixed in? We are running Version 2.9.4 and it still shows up.

    #12417

    Intense Visions
    Keymaster

    This was fixed in version 2.9.5

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.