Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,221 through 2,235 (of 3,958 total)
  • Author
    Posts
  • 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 ๐Ÿ™‚

    in reply to: Composer #9357
    Anh TranAnh Tran
    Keymaster

    No problem, all done! I've just added composer/installers and set the package type to wordpress-plugin. Now you can use it ๐Ÿ™‚

    Anh TranAnh Tran
    Keymaster

    You can use rwmb_{$field_type}_value or rwmb_{$field_id}_value. Please see this docs.

    in reply to: Prevent terms order being overwritten when updating post #9346
    Anh TranAnh Tran
    Keymaster

    No 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!

    in reply to: Prevent terms order being overwritten when updating post #9344
    Anh TranAnh Tran
    Keymaster

    Ooops, I was thinking you're using the taxonomy field 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?

    in reply to: Prevent terms order being overwritten when updating post #9340
    Anh TranAnh Tran
    Keymaster

    Hi,

    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?

    in reply to: WP_Query meta query on group field #9330
    Anh TranAnh Tran
    Keymaster

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

    in reply to: Composer #9329
    Anh TranAnh Tran
    Keymaster

    Finally, I can make it work. I wrote the documentation for Composer here. Please try that and let me know how it goes.

    in reply to: โœ…how it will work for front end ? #9326
    Anh TranAnh Tran
    Keymaster

    Hello,

    We're working on the user profile update that allows you to create user login / register and edit profile page in the frontend. The release plan was last week, but there're some bugs that we're fixing. We'll let you know when it done asap.

    in reply to: rwmb_get_value( ) accepted argument request #9325
    Anh TranAnh Tran
    Keymaster

    Well, you can do a simple query like this:

    global $wpdb;
    $values = $wpdb->get_result( $wpdb->prepare( "SELECT * FROM your_table WHERE ID=%d", $post_id ), ARRAY_A );
    in reply to: rwmb_get_value( ) accepted argument request #9321
    Anh TranAnh Tran
    Keymaster

    Hi, why don't you just use get_post_meta() instead? Using the helper function will run through all custom fields and prepare the values for all of fields, which is an extensive job. It's not a good choice for performance.

Viewing 15 posts - 2,221 through 2,235 (of 3,958 total)