Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,801 through 1,815 (of 3,702 total)
  • Author
    Posts
  • in reply to: Display fields with confirmation notice #11225
    Anh TranAnh Tran
    Keymaster

    Hi Joe,

    Yes, it's available in the AIO plugin as well. We'll work on the Frontend Submission next week.

    Anh

    in reply to: Filter the orderby of entries retrieved from database #11218
    Anh TranAnh Tran
    Keymaster

    Hi Juanita,

    You can overwrite the orderby parameter with this code:

    add_filter( 'posts_clauses', function( $clauses, $query ) {
        $relationship = $query->get( 'relationship' );
        if ( ! $relationship || 'REL_ID' != $relationship['id'] ) ) {
            return $clauses;
        }
        $clauses['orderby'] = 'ORDER BY post_date DESC';
        return $clauses;
    }, 99, 2 );

    It overwrites the orderby in the query. You might change it to fit your needs.

    Anh TranAnh Tran
    Keymaster

    Yes, the city is just a text field and you can use [rwmb_meta] shortcode to show it:

    [rwmb_meta meta_key="city"]

    For details, please see the documentation.

    in reply to: Advanced image #11216
    Anh TranAnh Tran
    Keymaster

    Hello,

    I've just tested and the image_size parameter works. Here is a screenshot:

    https://imgur.elightup.com/9O6rSZB.png

    Just a note: when the size specified in image_size parameter is not available, the full size is used. That might be your case.

    in reply to: Disable (delete) fields that are hidden conditionally? #11215
    Anh TranAnh Tran
    Keymaster

    Hello,

    Unfortunately, at the moment, CF only hides the fields. Clearing the values might lead to another unexpected behavior: users enter data in field A, and then hide it. After that, they changed their mind and show it. And they might expect the value they already entered.

    Let me work on the JS. I think I can add a custom JS event to the field when it's hid, so you can clear the value yourself. This is my idea:

    $( 'input' ).on( 'cl_hide', function() {
        this.value = '';
    } );

    Regarding the issue with Geolocation, I'll check and update. Thanks for letting me know.

    in reply to: Value of unchecked checkboxes/switches #11214
    Anh TranAnh Tran
    Keymaster

    Just want to note to this topic: the original bug with switch value is resolved, and the discussion continues here.

    in reply to: Button Group - Merging options #11213
    Anh TranAnh Tran
    Keymaster

    Yes, button groups act exactly like checkbox list or radio fields, where you specify the buttons' values and labels. So, please enter the buttons as options in the same format.

    in reply to: Extended Data for WooCommerce Products #11212
    Anh TranAnh Tran
    Keymaster

    I have answered these questions via email. I'll post them here in case anyone has a similar problem:

    Would storing the Meta Box data in a separate db table keep the relationship with each product ID it was entered on

    The answer for this is YES. There's a relationship between the products (posts table) and the custom table. Technically, the value of the custom table's ID column = product (post) ID.

    Whats the best approach to something like this?

    If what you meant is exporting the data in the custom table when using the export functionality of WordPress, then I have to say it's not supported. WP export feature seems to be limited to custom fields that stored in the post_meta table only.

    I have no good solution for this at the moment, as the task of exporting and importing data from custom table along with the product data seems to be complicated. It's best to use some tools or plugins to export the whole database to SQL file. But I guess it's not what you want.

    in reply to: Problem with additional custom field in existing meta box #11211
    Anh TranAnh Tran
    Keymaster

    Hi Kasia,

    Glad that the problem is resolved.

    I'm not sure about the bug, neither. Maybe it's some kind of caching / proxy. Some browsers (like Firefox) auto caches the page. So, next time, try to clear the browser cache first.

    I'll mark this topic as resolved. If you need any help, please just reply.

    in reply to: Delete options field MB Settings Page #11210
    Anh TranAnh Tran
    Keymaster

    Hi,

    The old field is an element in the option array. To delete it, simply unset it:

    $option = get_option( 'settings' );
    $option['new-text'] = $option['Text-old'];
    
    // THIS
    unset( $option['Text-old'] );
    update_option( 'settings', $option );
    in reply to: Events to Venues #11209
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    The title parameter should be wrapped inside a meta_box parameter, like this:

    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( array(
            'id'   => 'posts_to_pages',
            'from' => array(
                'object_type'  => 'post',
                'post_type'    => 'session-sponsor',
                'admin_column' => true,
                'meta_box'     => array(
                    'title' => 'Sponsor',
                ),
            ),
            'to'   => array(
                'object_type'  => 'post',
                'post_type'    => 'session',
                'admin_column' => 'after title',
                'meta_box'     => array(
                    'title' => 'Sponsor',
                ),
            ),
        ) );
            MB_Relationships_API::register( array(
            'from' => array(
                'object_type'  => 'post',
                'post_type'    => 'speaker',
                'admin_column' => true,
                'meta_box'     => array(
                    'title' => 'Sponsor',
                ),
            ),
            'to'   => array(
                'object_type'  => 'post',
                'post_type'    => 'session',
                'admin_column' => 'after title',
                'meta_box'     => array(
                    'title' => 'Speaker',
                ),
            ),
        ) );
    } );
    in reply to: One to many & many to many post relationships #11208
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    I fixed the snippet in the KB. In this case, I think it can be done with this code:

    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( array(
            'id'   => 'sessions_to_speakers',
            'from' => 'session',
            'to'   => 'speaker',
        ) );
        MB_Relationships_API::register( array(
            'id'   => 'sessions_to_sponsors',
            'from' => 'session',
            'to'   => 'sponsor',
        ) );
    } );

    To show the related information (speakers, sponsors) when displaying sessions, please try this code:

    // Display speakers
    $speaker_query = new WP_Query( array(
        'relationship' => array(
            'id'   => 'sessions_to_speakers',
            'from' => get_the_ID(),
        ),
        'nopaging'     => true,
    ) );
    while ( $speaker_query->have_posts() ) : $speaker_query->the_post();
        ?>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <?php
    endwhile;
    wp_reset_postdata();
    
    // Display sponsors
    $sponsor_query = new WP_Query( array(
        'relationship' => array(
            'id'   => 'sessions_to_sponsors',
            'from' => get_the_ID(),
        ),
        'nopaging'     => true,
    ) );
    while ( $sponsor_query->have_posts() ) : $sponsor_query->the_post();
        ?>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <?php
    endwhile;
    wp_reset_postdata();
    in reply to: Add fields to Genesis Custom Post Type Archive Metabox #11207
    Anh TranAnh Tran
    Keymaster

    Hello Juanita,

    I think it's possible. CMB2 and Meta Box is quite similar. However, I don't have Genesis and I can't give you the exact code that works.

    in reply to: Populate Relationships from frontend #11206
    Anh TranAnh Tran
    Keymaster

    Hi Giovanni,

    Unfortunately, it's not possible. The plugin works only in the backend.

    in reply to: Using shortcode as hyperlink #11205
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    Can you try changing it to:

    <a href="[rwmb_meta meta_key='event_register']">Register</a>

    I think it's the problem of using double quotes inside double quotes.

Viewing 15 posts - 1,801 through 1,815 (of 3,702 total)