Forum Replies Created
-
AuthorPosts
-
July 23, 2023 at 9:16 PM in reply to: [REQUEST] Need a MB developer for frontend customization for Gutenberg #42727
Kevin
ParticipantI sent you an email GV.
Kind regards
KKevin
ParticipantHi Peter,
Thanks for your reply.
Sorry to say, but the solution you provide is not really what i need.
Btw, I understand that there’s currently nothing up that way.
For my purpose, clients have to set up form
Fields on their own, that is why I asked for a wysiwyg in custom_html field.
That would be a very powerful features !Again, thanks for your answer,
I’ll try to do it on my way, and surely keep you updated.Have a nice day !
KJuly 20, 2023 at 11:03 PM in reply to: ℹ️[REQUEST] Create a set of custom fields that you can call from the builder #42703Kevin
ParticipantHello Peter,
Thanks for your answer,
You should check the link i provided : https://drive.google.com/file/d/1VhqhgDx9Qia2_gJrMlpVmtVgyTdsTe4g/view?usp=drive_link
it's packed and ready to use :), all you have to do it's include it in functions.php
A new field type called "include another mb" (include_mb) appears on builder (could be used in pure php as well), and provide a simple way to include a metabox to another metabox by letting you choose wich metabox you would like to include.
BTW, it will need some improvements, so i let you forward this to the MB team,
a simple mention if you choose to integrate it would be a nice move 🙂Happy to help,
have a nice day,
KLKevin
ParticipantCan't :/
This is my full time job, and i just gave you an hand this time.Have a nice day !
Kevin
Participanti just gave you access 🙂
July 20, 2023 at 2:36 PM in reply to: ℹ️[REQUEST] Create a set of custom fields that you can call from the builder #42683Kevin
ParticipantJuly 20, 2023 at 1:28 PM in reply to: ℹ️[REQUEST] Create a set of custom fields that you can call from the builder #42681Kevin
ParticipantHi,
figured it out, here's the function, if anyone need it. :
function my_custom_callback_metabox( $saved, $field ){ $added_registry = rwmb_get_registry( 'meta_box' ); $added_meta_box = $added_registry->get( 'metabox_id' ); $post_id = get_the_ID(); $added_meta_box->object_id = $post_id; $added_meta_box->saved = $saved; return $added_meta_box->show(); }I will pack it soon in a new field type, and repost it here. could be a great update !
July 19, 2023 at 9:45 PM in reply to: ℹ️[REQUEST] Create a set of custom fields that you can call from the builder #42669Kevin
Participanthi again,
i get to something with custom_html field and a callback, but it doesn't save anything at all.
here's my callback for custom html :
function my_custom_callback_metabox(){ $meta_box_registry = rwmb_get_registry( 'meta_box' ); $meta_box = $meta_box_registry->get( 'the_meta_box_i_callback' ); //render the form return $meta_box->show(); }if any of you have a clue,
thanks again and have a nice day !Kevin
Participantas i say, it's MB builder compatible eg: you will have a "math Operator" field available on "visual builder".
simple and easy.
give it a tryHave a nice day
Kevin
ParticipantHello Peter,
i'm aware of that functions, but it only return an array of fields that have been set in a metabox. what i wanted was to have all fields type existing in metabox, like the listing you have in MB Builder.
BTW, using the
mbb_field_typesfilter, i was able to get what i wanted.Many thanks for your help !
Have a nice day,KL
Kevin
ParticipantNBB : You have to include it via
functions.phpin your themeKevin
ParticipantHi GV,
Here's a custom Fields i've wrote to do so : https://drive.google.com/file/d/1VOTBfJS5LnTdgc2N5hLi6VjUBSZrpmN-/view?usp=sharing
it supports MB builder and will display a field with the sum of other fields.
here's a working example :
[ 'name' => __( 'Price', 'your-text-domain' ), 'id' => 'id_price', 'type' => 'number', 'min' => 1, 'max' => 10000, 'step' => 1, ], [ 'name' => __( 'Taxes', 'your-text-domain' ), 'id' => 'id_taxes', 'type' => 'number', 'min' => 1, 'max' => 30, 'step' => 1, ], [ 'name' => __( 'Taxes', 'your-text-domain' ), 'id' => 'id_delivery', 'type' => 'number', 'min' => 1, 'max' => 200, 'step' => 1, ], [ 'name' => __( 'Sum Price+Taxes+Delivery', 'your-text-domain' ), 'id' => 'sum_price_taxes_delivery', 'type' => 'math_operator', 'id_to_sum' => 'id_price,id_taxes,id_delivery', ]Where you will see a new type of fields called
math_operatorand whereid_to_sumis the id you want calculation for.NB : it only support sum for the moment.
Have a nice day,
KL
August 24, 2022 at 5:41 PM in reply to: ✅Error while inserting $field_id in rwmb_after_save_post #38017Kevin
ParticipantHi Luong,
bs_dateis one of my creation, it's a custom field based on Bootstrap datepicker, wich is, in my opinion and experience, far better than jqueryUI datepicker.Maybe you could have a look on it for a later implementation on MB ?
by the way, thanks for all your fantastic works
have a nice day,
KevinAugust 24, 2022 at 5:33 PM in reply to: ✅Error while inserting $field_id in rwmb_after_save_post #38016Kevin
Participanthi ben06,
you can use the following code for sorting your group by date
add_action( 'rwmb_pieces_jointes_et_dates_after_save_post', function($object_id){ $pj = $_POST['pieces_jointes_et_dates']; //sorting by date with usort usort($pj, function($a, $b) { //convert date_fichier DD/MM/YYYY with datetime to get a timestamp that you can sort $a_date = DateTime::createFromFormat('d/m/Y', $a['date_fichier']); $b_date = DateTime::createFromFormat('d/m/Y', $b['date_fichier']); return $a_date->getTimestamp() - $b_date->getTimestamp(); }); //Then update the whole group value update_post_meta($object_id,'pieces_jointes_et_dates', $pj ); } );Have a nice day 🙂
May 17, 2022 at 12:41 AM in reply to: ℹ️Suggestion : Action before/after encoded string in wrap_function_call() #36045Kevin
ParticipantSorry,
have another idea, on the same files here's the final code :
file : wp-content/plugins/meta-box-aio/vendor/meta-box/mbb-parser/src/Encoders/MetaBox.phpprivate function wrap_function_call() { $before = apply_filters('rwmb_mbb_before_php_output', ''); $after = apply_filters('rwmb_mbb_after_php_output', ''); $this->encoded_string = sprintf( '<?php add_filter( \'rwmb_meta_boxes\', \'%1$s\' ); function %1$s( $meta_boxes ) { $prefix = \'%3$s\'; %4$s $this_id = \'%6$s\'; $meta_boxes[$this_id] = %2$s; %5$s return $meta_boxes; }', $this->function_name, $this->encoded_string, $this->prefix, $before, $after, $this->settings['id'] ); return $this; }basically, you could extend the php output for get some variables first (before) and modify the $meta_boxes array by calling it with the $this_id index to some more depending on conditions or whatever you like to. very powerful !
Just a suggestions, as i said, but would be an awesome features for developers.
Have a nice day, and thanks again,
Kevin -
AuthorPosts