Title: [Plugin: Yet Another Related Posts Plugin] version 3.4 throws error: warning: array_merge(): argumen
Last modified: August 20, 2016

---

# [Plugin: Yet Another Related Posts Plugin] version 3.4 throws error: warning: array_merge(): argumen

 *  Resolved [azn137](https://wordpress.org/support/users/azn137/)
 * (@azn137)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/)
 * The title says it all, here’s the text of the error message:
 * **Warning: array_merge() [function.array_merge]: Argument #2 is not an array 
   in [blah blah]/class-core.php on line 141** _(also, line 146)_
 * Any idea why?
 * [http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/](http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/page/2/?output_format=md)

 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446174)
 * same problem
 *  Thread Starter [azn137](https://wordpress.org/support/users/azn137/)
 * (@azn137)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446182)
 * Looks like the previous version didn’t overload this function, and this one just
   borked it. Here’s the offending function:
 *     ```
       function get_option( $option = null ) {
       		$options = get_option( 'yarpp' );
       		// ensure defaults if not set:
       		$options = array_merge( $this->default_options, $options );
       		// some extra work is required for arrays:
       		foreach ( $this->default_options as $key => $default ) {
       			if ( !is_array($default) )
       				continue;
       			$options[$key] = array_merge( $this->default_options[$key], $options[$key] );
       		}
       		if ( !isset($options['weight']['tax']) )
       			$options['weight']['tax'] = $this->default_options['weight']['tax'];
   
       		if ( is_null( $option ) )
       			return $options;
   
       		$optionpath = array();
       		$parsed_option = array();
       		wp_parse_str($option, $parsed_option);
       		$optionpath = $this->array_flatten($parsed_option);
   
       		$current = $options;
       		foreach ( $optionpath as $optionpart ) {
       			if ( !is_array($current) || !isset($current[$optionpart]) )
       				return null;
       			$current = $current[$optionpart];
       		}
       		return $current;
       	}
       ```
   
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446183)
 * What happens if you change line 139 to be
 * `$options = (array) get_option( 'yarpp', array() );`
 * ?
 *  [rahmis](https://wordpress.org/support/users/rahmis/)
 * (@rahmis)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446197)
 * Thanks mitcho. That did the trick for me.
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446199)
 * I pushed this hotfix to the 3.4 tag… hopefully wordpress.org will repackage it
   quickly.
 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446204)
 * how will we know if it has been fixed? an upgrade notification?
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446208)
 * The zip archive has been updated. Just download again and replace your files:
 * [http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.4.zip](http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.3.4.zip)
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446209)
 * Thanks for the quick report!
 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446218)
 * thanks! where are the previous settings on the plugin? like the accuracy for 
   related posts
 *  Thread Starter [azn137](https://wordpress.org/support/users/azn137/)
 * (@azn137)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446219)
 * That zip did the trick for me. Thanks.
 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446221)
 * saw it already, screen options
 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446258)
 * why is it that there are no related posts being displayed?
 * another error i noticed:
 * when you check the SHOW excerpt this message appears on the textbox
 * <b>Warning</b>: array_merge() [[function.array-merge](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/function.array-merge?output_format=md)]:
   Argument #2 is not an array in <b>/home/mysite/public_html/v2/wp-content/plugins/
   yet-another-related-posts-plugin/class-core.php</b> on line <b>146</b>
    <small
   >
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446264)
 * [@jlapitan](https://wordpress.org/support/users/jlapitan/) you’ll want to replace
   your files with the new 3.4 zip.
 *  [jlapitan](https://wordpress.org/support/users/jlapitan/)
 * (@jlapitan)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446267)
 * i did
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/#post-2446281)
 * If you’re using the 3.4 zip from wordpress.org, there is no array_merge function
   on line 146:
 * [https://plugins.trac.wordpress.org/browser/yet-another-related-posts-plugin/tags/3.4/class-core.php#L146](https://plugins.trac.wordpress.org/browser/yet-another-related-posts-plugin/tags/3.4/class-core.php#L146)

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/page/2/?output_format=md)

The topic ‘[Plugin: Yet Another Related Posts Plugin] version 3.4 throws error: 
warning: array_merge(): argumen’ is closed to new replies.

 * ![](https://ps.w.org/yet-another-related-posts-plugin/assets/icon-256x256.png?
   rev=2549977)
 * [YARPP - Yet Another Related Posts Plugin](https://wordpress.org/plugins/yet-another-related-posts-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-related-posts-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-related-posts-plugin/reviews/)

 * 18 replies
 * 4 participants
 * Last reply from: [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-version-34-throws-error-warning-array_merge-argument-2-is-not-an-array/page/2/#post-2446309)
 * Status: resolved