Forum Replies Created
-
AuthorPosts
-
Jackky
ParticipantIt's not just about options, it's about custom filters like 'tiny_mce_before_init', 'teeny_mce_buttons' etc.
Let me know, please, then get any results. Waiting for fixing it, thank you!Jackky
ParticipantHello! I'm just wondering: still no solutions for applying custom hooks for tinymce?
Jackky
ParticipantI got this is guten core feature, and it have similar behavior with default blocks, so it's ok
Jackky
ParticipantI've tryed different combinations, and this too, but nothing works as I want
Jackky
ParticipantI've noticed it's because this style
.editor-styles-wrapper h4 { margin-top: 1.33em; margin-bottom: 1.33em; }But this is added by gutenberg by default. Also my suggestion is to refactor all the markup of MetaBox with html 5 and BEM metodology. In this case there will be no conflicts with other styles.
Jackky
ParticipantI've checked now how is working classic editor standart block, and it applying all the hooks and styles from my theme
Jackky
ParticipantAlso I have noticed, that opts like 'teeny', my custom hooks on tinymce, like custom formst select, buttons and styles doesn't take effect inside getenberg block. TinyMCE rendering as is. And this issue not only inside clonable group.
Jackky
ParticipantJust find out, I can do it with $_POST['post_id']
Jackky
ParticipantYeah, I know, but it's likely for me to disable every functions that I'm not using in frontend for security purposes. So I wanna make a suggestion to make some filters for MB, that allows to load only that functions I need, like rendering block template, not all helpers.
Jackky
ParticipantI have find out the issue. It's because I'm wrapping init of mb in is_admin condition like this:
if (is_admin()) { add_filter( 'rwmb_meta_boxes', 'register_meta_boxes' ); add_filter( 'mb_settings_pages', 'settings_pages' ); }How can I load render template on frontend with saving this condition?
Jackky
ParticipantI need this field too
Jackky
ParticipantIt's hard to explain, but let me give you a comparison. You are holding collapse state of collapible group while 'save_state' is set to true. I want to have a simular logic for each cloned item. The result will be like:
'group_name' => [ 'text' => 'value', 'etc' => 'value', ... '__clone_id' => 'group_XXX' // XXX - unque counter value ]Jackky
Participantalso offtop: 'default_state'=> 'collapsed', not working for me( Latest version installed, ofcourse
Jackky
Participantyes, autocomplete, than typing 2-3 letters. Also you first thouth right - if you will make request via ajax to standart query for all posts - it will not reduce the number of requests, but it will improve the page loading time with requesting heavy query async. Also for now, I have reduced my admin page load time from 30s to 6s (it's localhost, prod server more better) with simple construction:
$all_products = []; $args = array( 'posts_per_page' => -1, 'post_type' => 'product' ); $query = new WP_Query( $args ); if ( $query->have_posts() ): while ( $query->have_posts() ): $query->the_post(); $all_products[get_the_ID()] = get_the_title(); endwhile; endif;and then
array( 'id' => 'order_products', 'type' => 'group', 'clone' => true, 'sort_clone' => true, 'collapsible' => true, 'save_state' => true, 'default_state'=> 'collapsed', 'group_title' => array( 'field' => 'product_id' ), 'add_button' => 'Добавить товар', 'fields' => array( array( 'name' => 'Товар', 'id' => 'product_id', 'type' => 'select_advanced', 'options' => $all_products, 'class' => 'product_id' ),Jackky
Participantfigured out with address field - I have placed it outside of group field and using just for address searching (but there an issue - you need to update page after map clone)
-
AuthorPosts