PHP Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference

Cập nhật lần cuối vào

Đoạn code bên dưới sẽ giúp bạn khắc phục cảnh báo PHP Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference. Bạn mở tập tin functions.php của giao diện và thêm vào đoạn code như sau:

if ( function_exists( 'qtranxf_postsFilter' ) && has_filter( 'the_posts', 'qtranxf_postsFilter' ) ) {
	remove_filter( 'the_posts', 'qtranxf_postsFilter', 5 );

	function hocwp_theme_custom_the_posts_filter( $posts, $query ) {
		qtranxf_postsFilter( $posts, $query );

		return $posts;
	}

	add_filter( 'the_posts', 'hocwp_theme_custom_the_posts_filter', 5, 2 );
}

Cảnh báo này được sinh ra khi bạn dùng plugin qTranslate X để làm song ngữ cho WordPress. Sau khi thêm đoạn code trên vào tập tin functions.php của giao diện rồi thì bạn lưu lại, sau đó kiểm tra bằng cách refresh trình duyệt nhé. Chúc bạn thành công.

Theo dõi
Thông báo của
guest

0 Comments
Phản hồi nội tuyến
Xem tất cả bình luận