Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,191 through 2,205 (of 3,708 total)
  • Author
    Posts
  • in reply to: New Google maps pricing policy and MB geolocation #9462
    Anh TranAnh Tran
    Keymaster

    Hi 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.

    in reply to: New Google maps pricing policy and MB geolocation #9450
    Anh TranAnh Tran
    Keymaster

    I 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 TranAnh Tran
    Keymaster

    Sorry, can you try again now?

    in reply to: Change confirmation message after submission #9427
    Anh TranAnh Tran
    Keymaster

    Hi,

    Why don't you use the confirmation attribute of the shortcode? It's much easier and no coding required.

    Anh TranAnh Tran
    Keymaster

    Hi 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.

    in reply to: How to set a upload directory for file_upload #9416
    Anh TranAnh Tran
    Keymaster

    Hello,

    I've tested with upload_dir filter 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 only path and url, but also basedir and baseurl, 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-uploads folder in the root directory. As you see, basedir and baseurl, subdir are used to set the correct URL of the files.

    Please try that in your case and let me know how it works.

    in reply to: Groups revisions don't work #9413
    Anh TranAnh Tran
    Keymaster

    Thanks for letting us know. Let me check and fix it.

    in reply to: issue for tabs #9395
    Anh TranAnh Tran
    Keymaster

    Oh, 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.

    in reply to: Not able to get post_id in config as documented #9388
    Anh TranAnh Tran
    Keymaster

    Sorry, 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.

    in reply to: How to set a upload directory for file_upload #9381
    Anh TranAnh Tran
    Keymaster

    Hi,

    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.

    Anh TranAnh Tran
    Keymaster

    This 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>';
    }
    in reply to: issue for tabs #9372
    Anh TranAnh Tran
    Keymaster

    I 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?

    Anh TranAnh Tran
    Keymaster

    I 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 $post is available. Otherwise it won't work. You can try this instead:

    $passaggio = get_post_meta( get_the_ID(), 'gruppo_birra', true );

    in reply to: issue for tabs #9359
    Anh TranAnh Tran
    Keymaster

    Hello,

    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?

    Anh TranAnh Tran
    Keymaster

    Hi,

    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 called rwmb_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.php file of your theme. That's all.

    Hope that's clear 🙂

Viewing 15 posts - 2,191 through 2,205 (of 3,708 total)