Support » Plugin: WP Review » WordPress 4.0 Notice !!!

  • Resolved olziinaa

    (@olziinaa)


    Notice: Undefined index: type__in in C:\xampp\htdocs\wordpress40\wp-content\plugins\wp-review\includes\functions.php on line 472

    Notice: Undefined index: type__not_in in C:\xampp\htdocs\wordpress40\wp-content\plugins\wp-review\includes\functions.php on line 474

    I’ve tested your plugin on WordPress 4.0 but this notice shows on my wordpress. It is fine on WordPress 4.4.2. Can you fix this notice on WordPress 4.0

    Thanks

    https://wordpress.org/plugins/wp-review/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author MyThemeShop

    (@mythemeshop)

    Hello,

    Sorry for the issues. Here’s how to fix those notices:
    Please open the plugin file includes/functions.php and find this part in it:

    function wp_review_exclude_review_comments(\WP_Comment_Query $query) {
    	if ( ! is_admin() && ( WP_REVIEW_COMMENT_TYPE_VISITOR !== $query->query_vars['type'] && ! in_array( WP_REVIEW_COMMENT_TYPE_VISITOR, (array) $query->query_vars['type__in'] )) ) {
    		$query->query_vars['type__not_in'] = array_merge(
    			is_array( $query->query_vars['type__not_in'] ) ? $query->query_vars['type__not_in'] : array(),
    			array( WP_REVIEW_COMMENT_TYPE_VISITOR )
    		);
    	}
    }

    Change it to this:

    function wp_review_exclude_review_comments(\WP_Comment_Query $query) {
    	if ( ! is_admin() && ( WP_REVIEW_COMMENT_TYPE_VISITOR !== $query->query_vars['type'] && ( ! isset($query->query_vars['type__in']) || ! in_array( WP_REVIEW_COMMENT_TYPE_VISITOR, (array) $query->query_vars['type__in'] ))) ) {
    		$query->query_vars['type__not_in'] = array_merge(
    			isset( $query->query_vars['type__not_in'] ) && is_array( $query->query_vars['type__not_in'] ) ? $query->query_vars['type__not_in'] : array(),
    			array( WP_REVIEW_COMMENT_TYPE_VISITOR )
    		);
    	}
    }

    That should fix it in WordPress 4.0. We may include the same fix in the next update.

    Thanks for the quick reply.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress 4.0 Notice !!!’ is closed to new replies.