Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,971 through 2,985 (of 3,707 total)
  • Author
    Posts
  • in reply to: Sortable custom admin columns? #4474
    Anh TranAnh Tran
    Keymaster

    I think the filter should be:

    $query->set( 'orderby', 'meta_value' );
    $query->set( 'meta_key', 'mm_fornavn' );
    $query->set( 'order', 'ASC' );

    For more info about the params, please read the Codex about WP_Query class.

    in reply to: Documentation PDF? #4473
    Anh TranAnh Tran
    Keymaster

    Unfortunately, we have only the online version of the documentation. We regularly update the documentation (with new parameters/tutorials) and the online documentation helps us to provide the content to users better.

    in reply to: Sortable custom admin columns? #4455
    Anh TranAnh Tran
    Keymaster

    Hi,

    For custom column that you created, you must specify the way to query the data to sort them. You might want to add a hook to pre_get_posts in the class constructor and then filter the query, like this:

    class Prefix_Custom_Admin_Columns extends MB_Admin_Columns_Post {
        function __construct() {
            parent::__construct();
            add_action( 'pre_get_posts', array( $this, 'filter' ) );
        }
        // Other methods
        function filter( $query ) {
            // Sample code to sort the data
            $query->set( 'orderby', 'post_date' );
            $query->set( 'order', 'ASC' );
        }
    }
    in reply to: Query posts by subfield #4454
    Anh TranAnh Tran
    Keymaster

    There's no direct way to query post by sub-fields of a group. Because the data is stored as a serialized array in the post meta. You might want to refer to some techniques to solve this:

    https://support.metabox.io/topic/reverse-query-on-clonable-post-metabox/
    https://support.metabox.io/topic/new-field-class-hooking-to-rwmb_after_save_post/
    https://support.metabox.io/topic/use-repeatable-meta-box-field-for-query-orderby/

    in reply to: Refund #4453
    Anh TranAnh Tran
    Keymaster

    Ok, no problem. It's done.

    in reply to: Behavior of Datetime field #4440
    Anh TranAnh Tran
    Keymaster

    Hi, thanks for reporting the bug. Let's track this issue on Github for better communication with other users as well. It belongs to the core plugin.

    in reply to: Set Selected by default in Radio box #4431
    Anh TranAnh Tran
    Keymaster

    Just add 'std' => 'no' to the field ๐Ÿ˜‰

    in reply to: Color Field: Alpha channel possible? #4430
    Anh TranAnh Tran
    Keymaster

    We're using the WordPress built-in color picker (Iris) and sadly it doesn't have alpha channel ๐Ÿ™

    in reply to: Single Image field? #4429
    Anh TranAnh Tran
    Keymaster

    Currently you can do that with 'max_file_upload' => 1 for image_advanced field ๐Ÿ™‚

    in reply to: โœ…How to 'specify path to config file' in theme mode? #4417
    Anh TranAnh Tran
    Keymaster

    Hi,

    I think there's a misunderstanding here. The extension provides UI for users to enter the config or specify the path to the config file (as instructed here). It doesn't work if you specify the path to the config file in your code.

    in reply to: Need help for Paging #4409
    Anh TranAnh Tran
    Keymaster

    How to you want your pagination to be?

    in reply to: Front-end display/input #4400
    Anh TranAnh Tran
    Keymaster

    Hi, currently, the plugin doesn't support showing the inputs in the frontend yet.

    in reply to: โœ…Using with Include_Exclude doesn't work #4390
    Anh TranAnh Tran
    Keymaster

    Yes, that would work, too. I'm refactoring the code to make it better ๐Ÿ™‚

    in reply to: โœ…Using with Include_Exclude doesn't work #4387
    Anh TranAnh Tran
    Keymaster

    I have a solution for that, but it requires both the core plugin and the extension to update. I'm thinking about backward compatibility.

    in reply to: Nested group php call #4378
    Anh TranAnh Tran
    Keymaster

    Ah, sorry, for image fields, the returned value is always an array. You need to change the code to:

    $object_imgs = isset( $sector['rw_sector-object-image'] ) ? $sector['rw_sector-object-image'] : array();
    if ( ! empty( $object_imgs ) ) {
        foreach ( $object_imgs as $object_img ) {
            echo '<div class="sector-object-img">
                <div class="slider slider-for">
                <img src="' . wp_get_attachment_image_url( $object_img, 'type=image_advanced&size=full&multiple=true' ) . '">
            </div>
            </div>';
        }
    }
Viewing 15 posts - 2,971 through 2,985 (of 3,707 total)