Home > CUSTOMIZED | WordPress > [wp×SQLite]Warning: array_merge()

[wp×SQLite]Warning: array_merge()

コメントを編集する際にエラーが出てきた。

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/qooga/public_html/wp/wp-includes/comment.php on line 1097

array_mergeに入れるのは両方配列でないといけない。
つまりどっちかが『配列じゃねぇ!!』てことみたいだ。

みてみたら$commentが『Array()』ではなくて『Array』。
確かに配列ではない。でもArray。
どゆこと!?
て思いながらとりあえずの修正。

/wp-includes/comment.phpを修正

以下の13行目を追記

function wp_update_comment($commentarr) {
	global $wpdb;

	// First, get all of the original fields
	$comment = get_comment($commentarr['comment_ID'], ARRAY_A);

	// Escape data pulled from DB.
	$comment = $wpdb->escape($comment);

	$old_status = $comment['comment_approved'];

	// Merge old and new fields with new fields overwriting old ones.
	if(count($comment) > 1)	// @to
	$commentarr = array_merge($comment, $commentarr);

	$commentarr = wp_filter_comment( $commentarr );

コメント出来た。

こんなん繰り返してたら、アップデートしづらくなるなぁ…


関連する投稿

Comments:0

Comment Form
Remember personal info

Trackbacks:1

Trackback URL for this entry
http://qooga.jb-jk.net/wp/2009/07/warning_array_merge_at_wordpress/trackback/
Listed below are links to weblogs that reference
http://qooga.jb-jk.net/wp[wp×SQLite]Warning: array_merge() from MOT:主にプログラム勉強メモ部屋
pingback from Seasonism Season3 - 最初にやったこと(WPコア編) 10-03-09 (火) 0:01

[...] MOT:主にプログラム勉強メモ部屋さんの記事を参考にして [...]

Home > CUSTOMIZED | WordPress > [wp×SQLite]Warning: array_merge()

Search
Option
  • Twitter
  • 絵板
Feeds
commercial
Mobile
Meta
Tag Cloud
TOP10
commercial

Return to page top