Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Michele and David,
Thanks a lot for your inputs. The inconsistent and unclear of information from Google is a big concern to us.
I'll check the OSM next week and will try to provide a quick workaround.
Anh Tran
KeymasterI got an email from Google 2 days ago regarding the same problem. It says that Google still provide free tier for user. The free usage is equivalent to $200 per month. Adding credit card to your billing info will be able to add a coupon to your account that increases the limit to $500 per month.
I attached the screenshots here so you can see the details:
https://imgur.com/gallery/h200Jhk
One big note in this announcement is that all fields that don’t have API key won’t work any longer.
So, I think in short terms, the Google Maps field still works if you already have a API key. However, in long term, we should figure out a better way. I’ll check Open Street Maps to see if we can integrate it.
Anh Tran
KeymasterSorry, can you try again now?
Anh Tran
KeymasterHi,
Why don't you use the
confirmationattribute of the shortcode? It's much easier and no coding required.Anh Tran
KeymasterHi again,
We've just updated the extension with able to save NULL value to the table. Now if the value is an empty string or empty array, it will be saved as NULL. Please update the extension and let us know how it goes.
Anh Tran
KeymasterHello,
I've tested with
upload_dirfilter and it works for Meta Box. However, it's important to note that the documentation on Codex is not accurate. If you use exactly what in the Codex, e.g.:add_filter( 'upload_dir', function ( $param ) { $mydir = '/awesome'; $param['path'] = $param['path'] . $mydir; $param['url'] = $param['url'] . $mydir; return $param; } );Then it will work.
However, if you want to move to a new directory other than
uploads, you need to change not onlypathandurl, but alsobasedirandbaseurl, like this:add_filter( 'upload_dir', function ( $param ) { $param['basedir'] = wp_normalize_path( ABSPATH . 'custom-uploads' ); $param['baseurl'] = home_url( '/custom-uploads' ); $param['path'] = $param['basedir']; $param['url'] = $param['baseurl']; $param['subdir'] = ''; return $param; } );The code above will upload files to
custom-uploadsfolder in the root directory. As you see,basedirandbaseurl,subdirare used to set the correct URL of the files.Please try that in your case and let me know how it works.
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 🙂
-
AuthorPosts