Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 4,839 total)
  • Author
    Posts
  • in reply to: Query advanced select field by relationship #33482
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If you want to get the current post ID when registering the meta box, please use this code

    $post_id = null;
    if ( isset( $_GET['post'] ) ) {
        $post_id = intval( $_GET['post'] );
    } elseif ( isset( $_POST['post_ID'] ) ) {
        $post_id = intval( $_POST['post_ID'] );
    }

    Refer to this topic https://support.metabox.io/topic/get-the-post-id-as-value/

    function qrsi_select_advanced( $meta_boxes ) {
        $prefix = '';
        $post_id = null;
        if ( isset( $_GET['post'] ) ) {
            $post_id = intval( $_GET['post'] );
        } elseif ( isset( $_POST['post_ID'] ) ) {
            $post_id = intval( $_POST['post_ID'] );
        }
        $meta_boxes[] = [
            ...
            'fields'     => array(
                array(
                    'name' => __( 'Courses Block 1', 'your-text-domain' ),
                    'id'   => $prefix . 'courses_block_1',
                    'type' => 'post',
                    'post_type' => 'course',
                    'field_type' => 'select_advanced',
                    'placeholder' => __( 'Select an Item', 'your-text-domain'),
                    'query_args' => array(
                        'relationship' => array(
                            'id'   => 'event-to-course-relationship',
                            'from' => $post_id,
                        ),
                    )
                )
            )
        ];
        return $meta_boxes;
    }

    Let me know if it works.

    in reply to: Could Not Get Field Value #33477
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The option_name of the settings page should be limit_settings. Please correct it and get the value again. Refer to this documentation https://docs.metabox.io/extensions/mb-settings-page/#using-code

    in reply to: New Blocks not showing in Widget Block Search #33474
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    The script files of MB Blocks only load on the post editing page. I will inform the development team to support it on the widget editing page.

    Long NguyenLong Nguyen
    Moderator

    Hi Paul,

    Yes, you can use this filter for any field, it is the HTML input of the field and is not affected by the value of the field (saved in a custom table or not).

    add_filter( 'rwmb_fieldID_html', function( $field_html, $field, $meta ) {
        $field_html .= '<p>Add your HTML code here</p>';
        return $field_html;
    }, 10, 3 );
    in reply to: email_confirmation succsesse page #33471
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Currently, there is no option to change the confirmation page. You can translate the text "Your account is confirmed successfully." to another language by using a translation plugin.

    in reply to: Custom Fields & Setting not showing on Edit Field Group #33460
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please try to deactivate all plugins except Meta Box, Meta Box AIO and switch to the standard theme of WordPress (Twenty TwentyOne) then re-check the issue.

    Let me know how it goes.

    in reply to: File uploads in user account #33459
    Long NguyenLong Nguyen
    Moderator

    Hi,

    To allow the users to upload files on the frontend to their profile, you need to use the profile shortcode. Please read more on the documentation https://docs.metabox.io/extensions/mb-user-profile/#edit-profile-form

    [mb_user_profile_info id="meta-box-id" submit_button="Submit" confirmation="Your information has been successfully submitted. Thank you."]

    Here is the example: https://monosnap.com/file/XRr2i07B54v2lWHUJpIDs5B0dsuYzR

    in reply to: Star Ratings output on View #33458
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The View will generate the field ID which you register under the meta box on step 4
    https://metabox.io/add-star-ratings-to-wordpress-on-backend/#step-4-create-custom-fields-to-add-star-ratings-with-mb-star-rating-plugin

    The plugin from Github helps you to create the custom field type. You also have to create a custom field based on that field type.

    But it will display the value of the rating field which should be 1, 2, 3 ... instead of stars. So you need to use the proxy to run the helper function rwmb_the_value() like the tutorial

    {{ mb.rwmb_the_value( 'rating' ) }}

    https://docs.metabox.io/rwmb-the-value/
    https://docs.metabox.io/extensions/mb-views/#running-php-functions

    I also see the file dashicons.ttf is missing in the plugin folder, you can copy it from the WP folder /wp-includes/fonts/dashicons.ttf to /wp-content/plugins/mb-rating-field-main/fonts/dashicons.ttf

    in reply to: How to display custom fields in Products List? #33454
    Long NguyenLong Nguyen
    Moderator

    Hi Sascha,

    You need to add the ID of the column to show a custom field column before/after that column. The ID of the product categories column is product_cat, screenshot https://monosnap.com/file/7BqsTDfQoB0Hxqp1dO90UBgLa3JG1H

    And please notice, you should never share the credentials via this public forum. If you want, please share it via this contact form https://metabox.io/contact/

    in reply to: Query advanced select field by relationship #33452
    Long NguyenLong Nguyen
    Moderator

    Hi Ryan,

    "Courses are connected to Events" so there is a relationship meta box shows the courses connect to the current event and you can add more courses connected. Why do you need to create a new field post which works like the relationship?

    The difference is the field post saves the value as post meta in the table wp_postmeta while the relationship saves the value in a custom table wp_mb_relationships.

    in reply to: Meta_Query with Custom Tables and Orderby #33442
    Long NguyenLong Nguyen
    Moderator

    Hi,

    No, it is not supported to use custom table meta with WP Query. You can query posts by getting the post IDs in the custom table.

    global $wpdb;
    $ids = $wpdb->get_col( "SELECT ID FROM your_table WHERE field1 = 'value1' OR field2 = 'value2'" );
    
    if ( empty( $ids ) ) {
        echo 'There is no posts';
    } else {
        $query = new WP_Query( [
            'post_type' => 'post',
            'post__in'  => $ids,
        ] );
        // Do something
    }
    in reply to: Views Shortcode filter by taxonomy #33441
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Here is an example:

    {% set args = { post_type: "post", posts_per_page: 6, tax_query: [ { taxonomy: 'category', field: 'slug', terms: my_term } ] } %}
    
    {% set posts = mb.get_posts( args ) %}
    {% for post in posts %}
        <p>{{ post.post_title }}</p>
    {% endfor %}

    Shortcode:

    [mbv name="shortcode" my_term="uncategorized"]

    in reply to: Send email if checkbox is ticked #33431
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can just combine to code to add the post title to email content.

    add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
        $value = empty( $_POST['submit_form_for_review'] ) ? null : $_POST['submit_form_for_review'];
        if ( $value == 1 ) {
            $value = empty( $_POST['post_title'] ) ? null : $_POST['post_title'];
            wp_mail( '[email protected]', 'New submission', 'A new post has been just submitted from '. $value .' user' );
            wp_safe_redirect( 'submitted' );
            die;
        }
    }, 10, 2 );
    in reply to: Star Ratings output on View #33430
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If you follow the tutorial to create the rating field, you can click on the button Insert Field and select the rating field to output with the view.

    {{ post.rating }}

    in reply to: MB Views get term name #33429
    Long NguyenLong Nguyen
    Moderator

    Hi,

    There is no problem with the dash or underscore character. Please correct the field ID, taxonomy slug (not the term slug) and check the output value again.

Viewing 15 posts - 1,591 through 1,605 (of 4,839 total)