Forum Replies Created
-
AuthorPosts
-
Fede
ParticipantThanks, I finally solved it by using the normalize filter of the field:
add_filter('rwmb_normalize_languages_field', function($field) { $field['options'] = ks_get_languages(); return $field; });Fede
ParticipantI expose my complete casuistry because it still does not work:
I have a custom post type with no editor support.
https://imgur.com/a/RnZBC4c
Associated to that CPT I have a group of fields, one of the fields is a WYSIWYG editor with the ID 'post_content'.
https://imgur.com/a/3HPGWA2
In the code of a plugin I have the AJAX call to action:add_action('wp_ajax_check_descripcion', 'ks_validate_descripcion'); function ks_validate_descripcion() { echo 'false'; die(); }When I submit the frontend form, the validation occurs and I can see the error message set in the MB Builder 'description failure', but the form submission continues its execution and ends up saving the post.
If the CPT doesn't have editor support, I'm not using the block editor, am I?
How can I make the validation stop?
Thanks.
Fede
ParticipantI have set the full URL in the callback and it works, but only partially.
When I submit the form, the error message indicated in the MB Builder below the field appears briefly, but the validation continues and the post is saved.
What am I doing wrong, how do I stop the validation when I reach this field?
Fede
ParticipantIs it possible to use remote validation from the MB Builder interface? Which URL should I specify?
I'm trying this way and I can't get it to work:add_action('wp_ajax_check_descripcion', 'ks_validate_descripcion'); function ks_validate_descripcion() { echo 'false'; die(); }September 1, 2021 at 3:42 PM in reply to: How can I configure the WYSYGYG editor options in MB Frontend Submission? #30534Fede
ParticipantThis is the code I am using and it does not work to customize the editor for the fake content field:
public function ks_editor_trabajo_realizado($meta_boxes) { $post_id = filter_input(INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT); $post_content = get_post_field('post_content', $post_id); $meta_boxes[] = [ 'title' => 'Descripción del trabajo', 'post_types' => 'trabajo-realizado', 'fields' => [ [ 'type' => 'wysiwyg', 'id' => 'content', 'name' => 'Descripción', 'std' => $post_content, 'save_field' => false, 'options' => [ 'textarea_rows' => 3, 'media_buttons' => false, 'teeny' => false, 'quicktags' => false, 'tinymce' => [ 'media_buttons' => false, ] ] ], ], ]; return $meta_boxes; }Any help please?
September 1, 2021 at 12:39 AM in reply to: How can I configure the WYSYGYG editor options in MB Frontend Submission? #30525Fede
ParticipantI can't edit the text above (there were mixed references). This is the other code I have tried:
-
AuthorPosts