Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterThanks for letting us know. Let me check and fix it.
Anh Tran
KeymasterOh, I see. It's MakiPlace's responsible to update the extensions for you. In the meantime, I've just added the Developer Bundle to your account and you can download the latest version of extensions. Please try and let me know how it goes.
Anh Tran
KeymasterSorry, the docs is incorrect. The submitted post ID is added separately as the 2nd parameter of the hook. Please change the code to this:
add_action ('rwmb_frontend_after_process','emnsh_rwmb_frontend_after_process', 10, 2); function emnsh_rwmb_frontend_after_process($config, $post_id) { if ($post_id') { $name = rwmb_meta('emnsh-name'); wp_update_post(array( 'ID' => $config['post_id'], 'post_title'=>$name )); } }I also updated the docs.
Anh Tran
KeymasterHi,
The plugin doens't change the way WP handles the upload process. Probably the ajax part has some issue. Let me see if I can do anything.
April 26, 2018 at 2:35 PM in reply to: MetaBox doesn't saves and it doesn't work with selected category #9380Anh Tran
KeymasterThis code:
$birra = isset( $passaggio['et2018-nome_birra'] ) ? $passaggio['et2018-nome_birra'] : '<a href="'.get_the_permalink().'" title="'.get_the_title().'"><p>Birra: '.$birra.'</p></a>';is wrong and can't work.
This code:
if (isset($passaggio['et2018-nome_birra'])){ $birra = $passaggio['et2018-nome_birra']; } echo '<a href="'.get_the_permalink().'" title="'.get_the_title().'"><p>Birra: '.$birra.'</p></a>';works. But it will show a warning if there is no value for
$passaggio['et2018-nome_birra']. And in case there's no value, it still show the<a>link.Please try this instead:
$birra = isset($passaggio['et2018-nome_birra']) ? $passaggio['et2018-nome_birra'] : ''; if ($birra) { echo '<a href="'.get_the_permalink().'" title="'.get_the_title().'"><p>Birra: '.$birra.'</p></a>'; }Anh Tran
KeymasterI got it. The HTML is different because of the MB Columns. You probably activated and used it on your localhost. Please try deactivating it first.
Anyway, I tested with the tabs and columns and they work pretty well together. Do you use the latest version of both plugins? Can you post your code here to test?
April 25, 2018 at 10:26 AM in reply to: MetaBox doesn't saves and it doesn't work with selected category #9366Anh Tran
KeymasterI think it's better to check like this:
$birra = isset( $passaggio['et2018-nome_birra'] ) ? $passaggio['et2018-nome_birra'] : '';So the variable is always available and won't display any warning if you do
echo $birra;.PS: You can get the group value your way or use the helper function like this:
$passaggio = rwmb_meta( 'gruppo_birra' );In your code, please make sure the global
$postis available. Otherwise it won't work. You can try this instead:$passaggio = get_post_meta( get_the_ID(), 'gruppo_birra', true );Anh Tran
KeymasterHello,
I've just tested the tabs and there's no problem with clicking. Can you please try again? Maybe there's some JS errors somewhere else that could break the plugin's behavior?
April 24, 2018 at 11:07 PM in reply to: How to filter value of spesific field before saving it to DB #9358Anh Tran
KeymasterHi,
The filter:
$new = apply_filters( "rwmb_{$field['id']}_value", $new, $field, $old );means that the value of the field (
$new) will run through a filter calledrwmb_YOURFIELDID_value. This filter has 3 params:$new: the submitted value of the field$field: field settings (array)$old: the current value of the field, which is stored in the custom field. If field is new, then it's an empty string.
So, to add a filter to change the field value, please run:
add_filter( 'rwmb_YOURFIELDID_value', function( $new, $field, $old ) { $new = 'Your new value'; return $new; }, 10, 3 );Just add it to your
functions.phpfile of your theme. That's all.Hope that's clear ๐
Anh Tran
KeymasterNo problem, all done! I've just added
composer/installersand set the package type towordpress-plugin. Now you can use it ๐April 24, 2018 at 1:37 PM in reply to: How to filter value of spesific field before saving it to DB #9348Anh Tran
KeymasterYou can use
rwmb_{$field_type}_valueorrwmb_{$field_id}_value. Please see this docs.April 24, 2018 at 11:22 AM in reply to: Prevent terms order being overwritten when updating post #9346Anh Tran
KeymasterNo problem. The MB Custom Taxonomy only set the taxonomy parameters. Other things are handled by WordPress itself.
I think we can close this topic :). Have a nice day!
April 24, 2018 at 10:18 AM in reply to: Prevent terms order being overwritten when updating post #9344Anh Tran
KeymasterOoops, I was thinking you're using the
taxonomyfield from Meta Box. If you're using the WordPress's core meta box for post tag, then it's out of the scope of the plugin. Maybe you should open a ticket for WordPress team?April 24, 2018 at 9:37 AM in reply to: Prevent terms order being overwritten when updating post #9340Anh Tran
KeymasterHi,
I'm not sure if the select advanced library support changing order of selected items. AFAIK it doesn't. That's why I was curious about how did you set the order for the terms in the previous reply.
The current workaround pushes the selected items to the bottom of the list and un-selected items to the top. It's kind of the unfriendly experience for users, but that's the only way to preserve the order of selected items. (You can see the details in the Github link I posted above. It's worth noting that this is a temporary solution, as it's NOT supported by the select2 library).
By the way, can you post the code you use for post_tag with Meta Box?
Anh Tran
KeymasterHi Mark,
It's kind of impossible for group. Group saves value as an serialized array, that's unable to query by. If you really need to query by a field, please make it a standalone field, not in a group.
-
AuthorPosts