Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Yves Newman
    Participant

    [25-Jan-2021 01:54:04 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, string given in /data/web/e35586/html/apps/wordpress-21637/wp-content/plugins/shortcoder/shortcoder.php on line 147
    [25-Jan-2021 01:54:04 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, string given in /data/web/e35586/html/apps/wordpress-21637/wp-content/plugins/shortcoder/shortcoder.php on line 159

    Shortcoder Version 5.3.4
    https://www.kerstinreithmayr.com

    Any idea what may be causing this?

    if( array_key_exists( ‘sc_id’, $atts ) ){
    $sc_id = $atts[ ‘sc_id’ ];
    foreach( $shortcodes as $temp_name => $temp_props ){
    if( $temp_props[ ‘id’ ] == $sc_id ){
    $sc_name = $temp_name;
    break;
    }
    }
    }

    and

    if( !$sc_name ){
    if( !array_key_exists( ‘name’, $atts ) ){
    return ‘<!– Shortcode is missing “name” attribute –>’;
    }
    $sc_name = $atts[ ‘name’ ];
    }

    Appreciate your help!

    Thanks

    Hi Yves,

    This is not expected unless some other plugin interfere with the shortcode.

    Shortcodes will ideally receive an array of parameters. In you case it is string.

    I’ll debug further on this and fix the issue in the next version.

    For now please add below line in shortcoder.php at line number 50

    $atts = (array) $atts;

    So the result is like below:

    49	    public static function execute_shortcode( $atts, $enclosed_content = null ){
    50	        $atts = (array) $atts;
    51	        $shortcodes = self::get_shortcodes();

    Thanks,
    Aakash

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam.