Error: php notice uninitialized string offset 0
-
When using the [poll] shortcode the debug log returns the error as shown below:
PHP Notice: Uninitialized string offset: 0 in D:\www\wordpress_new\wp-content\plugins\wp-polls\wp-polls.php on line 756
Possible cause: On line 756 in the wp-poll.php file the array $atts is called. It returns an error if not set in shortcode I think.
// To maintain backward compatibility with [poll=1]. Props @tz-ua if(!$id) { $id = intval( trim( $atts[0], '="\'' ) ); }
Possible solution I think could be something like this. Check if array is empty:
// To maintain backward compatibility with [poll=1]. Props @tz-ua if( empty($id) ) { // Do nothing } else { $id = intval( trim( $atts[0], '="\'' ) ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Error: php notice uninitialized string offset 0’ is closed to new replies.