admin管理员组文章数量:1122832
I need some help with the rest mode error handling in WP. In my CPT I use a metabox with different fields. If the user save the post there must be an error handling on the metabox fields.
With the Gutenberg editor I can use this for example
add_settings_error(
'missing-link',
'missing-link',
'Link may not empty!',
'error'
);
add_action('admin_notices', function(){
$message = '<div id="message" class="error"><p><ul>';
foreach ( $errors as $error ) {
$message .= '<li>' . $error['message'] . '</li>';
}
$message .= '</ul></p></div>';
echo $message;
});
But this does not work on the block editor / rest mode
How can I create my own error messages on the custom fields?
Hope somebody can help me a little with this
本文标签: Create error handling metabox fields WP block editorrest mode
版权声明:本文标题:Create error handling metabox fields WP block editorrest mode 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309874a1934176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论