
如何使用Gatsby为WordPress生成静态网站
rest_format_combining_operation_error ( $param, $error )
rest_format_combining_operation_error: 这个函数用于格式化包含组合操作(如allOf、anyOf或oneOf)的模式的错误信息,该操作未能验证。它接收一个错误信息的数组,并返回一个格式化的错误信息。
将一个组合操作错误形成一个WP_Error对象。
function rest_format_combining_operation_error( $param, $error ) { $position = $error['index']; $reason = $error['error_object']->get_error_message(); if ( isset( $error['schema']['title'] ) ) { $title = $error['schema']['title']; return new WP_Error( 'rest_no_matching_schema', /* translators: 1: Parameter, 2: Schema title, 3: Reason. */ sprintf( __( '%1$s is not a valid %2$s. Reason: %3$s' ), $param, $title, $reason ), array( 'position' => $position ) ); } return new WP_Error( 'rest_no_matching_schema', /* translators: 1: Parameter, 2: Reason. */ sprintf( __( '%1$s does not match the expected format. Reason: %2$s' ), $param, $reason ), array( 'position' => $position ) ); }