WPML
Trạng thái
Đã giải quyết
Được báo cáo cho
Advanced Custom Fields Multilingual 2.1.4
Đã giải quyết trong
Advanced Custom Fields Multilingual 2.1.4.1
Plugin/giao diện liên quan
Advanced Custom Fields (ACF)
Thẻ chủ đề
Bug

Tổng quan về lỗi

Nếu bạn đã cập nhật lên Advanced Custom Fields Multilingual phiên bản 2.1.4 trong khi sử dụng phiên bản miễn phí của Advanced Custom Fields, bạn có thể gặp phải lỗi nghiêm trọng do hàm không xác định acf_get_options_pages():

PHP Fatal error:  Uncaught SymfonyComponentDebugExceptionFatalThrowableError: Call to undefined function acf_get_options_pages() in .../wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php:281

Giải pháp tạm thời

Vui lòng đảm bảo bạn đã sao lưu toàn bộ trang web của mình trước khi tiếp tục.


  • Mở tệp …/wp-content/plugins/acfml/classes/class-wpml-acf-options-page.php.

  • Tìm dòng 280.

  • Thay thế:
    	private static function isValidOptionPagePostId( $postId ) {
    		return (bool) wpml_collect( acf_get_options_pages() )
    			->first( Relation::propEq( 'post_id', $postId ) );
    	}


  • Bằng:
    	private static function isValidOptionPagePostId( $postId ) {
    		return function_exists( 'acf_get_options_pages' )
    			&& wpml_collect( acf_get_options_pages() )->first( Relation::propEq( 'post_id', $postId ) );
    	}

Tất cả các lỗi đã ghi nhận →