• Hi,

    I do have this problem since updating the plugin:
    Warning: Illegal offset type in D:\hosting\6799661\html\wp\wp-content\plugins\contact-form-7\includes\shortcodes.php on line 15

    if you google for:
    “Warning: Illegal offset type in plugins\contact-form-7\includes\shortcodes.php on line 15”

    you’ll find thousands of those entries..

    Can you tell me how to fix the problem?

    Thanks

    http://wordpress.org/extend/plugins/contact-form-7/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    From what version to what version did you try to upgrade the plugin?

    Thread Starter wolfman123

    (@wolfman123)

    It think it was 3.3.3

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    How did you upgrade it? Did you use automatic upgrade?

    Thread Starter wolfman123

    (@wolfman123)

    yes, the automatic upgrade

    I was getting a similar error message when I updated Contact Form 7 to version 3.4.2. Replacing the add_shortcode function in wp-content/plugins/contact-form-7/includes/shortcodes.php from this:

    function add_shortcode( $tag, $func, $has_name = false ) {
        if ( is_callable( $func ) )
            $this->shortcode_tags[$tag] = array(
                'function' => $func,
                'has_name' => (boolean) $has_name );
    }

    …to this:

    function add_shortcode( $tag, $func, $has_name = false ) {
        if ( ! is_callable( $func ) )
            return;
    
        $tags = array_filter( array_unique( (array) $tag ) );
    
        foreach ( $tags as $tag ) {
            $this->shortcode_tags[$tag] = array(
                'function' => $func,
                'has_name' => (boolean) $has_name );
        }
    }

    …seemed to work for me. I think it has something to do with a change in PHP 5.4 and how it handles $this.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Warning: Illegal offset’ is closed to new replies.