Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 3,571 through 3,585 (of 4,839 total)
  • Author
    Posts
  • Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for reaching out.

    I'm afraid that it is not possible. We have to some actions like click, typing (keyup) to trigger the searching function.

    I will inform the development team to explore the possibility of this case.

    in reply to: JS error when validation metabox without tabs #26839
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    I've escalated this issue to the development team. It will be fixed in the next update as soon as possible.

    in reply to: Move Custom Field to another Group #26834
    Long NguyenLong Nguyen
    Moderator

    Hi webdev,

    Do you mean the field type group?
    https://metabox.io/plugins/meta-box-group/

    The data will be lost because the field ID is store in the database as a meta key. When you create a new field in a group field, the meta key is group ID so you have to add the field value again.

    in reply to: Meta Box custom fields not available in wpDataTables #26828
    Long NguyenLong Nguyen
    Moderator

    Hi Harness,

    Thank you for using our plugin.

    It looks like the plugin wpDataTables search in the database, table wp_postmeta for the meta key (field ID) to create a table/chart. There is no data in the table wp_postmeta when you just create meta boxes and custom fields, please try to add field value to some posts then update the post and re-check it.

    Long NguyenLong Nguyen
    Moderator

    Hi Henri,

    I've dived into this case and found a way to achieve this goal. We can use a query nested in the main query to get the connected post A > B > C as your expectation.

    I've created a post type book and have two relationships. Here is the code:

    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( [
            'id'    => 'posts_to_pages',
            'from'  => 'post',
            'to'    => 'page',
        ] );
    } );
    
    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( [
            'id'    => 'posts_to_books',
            'from'  => 'post',
            'to'    => 'book',
        ] );
    } );

    When displaying a page, I can show posts related to this page and books related to those posts

    $connected_post = new WP_Query( [
        'relationship' => [
            'id'   => 'posts_to_pages',
            'to' => get_the_ID(), // You can pass object ID or full object
        ],
        'nopaging'     => true,
    ] );
    while ( $connected_post->have_posts() ) : $connected_post->the_post();
        ?>
        <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
        <?php 
            $connected_book = new WP_Query( [
                'relationship' => [
                    'id'   => 'posts_to_books',
                    'from' => $connected_post->post->ID, // You can pass object ID or full object
                ],
                'nopaging'     => true,
            ] );
            while ( $connected_book->have_posts() ) : $connected_book->the_post();
                ?>
                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                <?php
            endwhile;
            $connected_book->reset_postdata();
    
         ?>
        <br>
        <?php
    endwhile;
    wp_reset_postdata();

    Let me know if it helped.

    in reply to: Google reCaptcha #26818
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I can create a new one as well, screenshots
    https://share.getcloudapp.com/bLuADm76
    https://share.getcloudapp.com/xQubpWKl

    in reply to: clone and readonly #26817
    Long NguyenLong Nguyen
    Moderator

    Hi,

    For some flexible cases, I think you can try to use the extension MB Conditional Logic. Example, you can show/hide a field base on a checkbox.
    https://docs.metabox.io/extensions/meta-box-conditional-logic/

    in reply to: Google reCaptcha #26813
    Long NguyenLong Nguyen
    Moderator

    Hi,

    After looking around on Google, I see the reCaptcha is still created here https://www.google.com/recaptcha/admin/create#list.

    Please try to create a new one while the development team is working to integrate the reCaptcha Enterprise.

    in reply to: clone and readonly #26810
    Long NguyenLong Nguyen
    Moderator

    Hi Davide,

    Thank you for reaching out.

    The group field does not support adding the setting readonly. This setting only applies to some simple fields like text, url, email, checkbox, radio, date, time, datetime which are sub-fields inside the group.

    in reply to: Settings page "switch" field - hopefully quick question #26808
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Here is an example:

    1. The code which I use to create a settings page and a meta box with a switch field
    2. add_filter( 'mb_settings_pages', 'custom_settings_page' );
      
      function custom_settings_page( $settings_pages ) {
          $settings_pages[] = [
              'menu_title'  => __( 'Options', 'project-name' ),
              'option_name' => 'my_options',
              'id'        => 'my_options',
              'position'    => 25,
              'columns'     => 1,
              'icon_url'    => 'dashicons-admin-generic',
          ];
      
          return $settings_pages;
      }
      
      add_filter( 'rwmb_meta_boxes', 'custom_sitewide_fields_group' );
      
      function custom_sitewide_fields_group( $meta_boxes ) {
          $prefix = '';
      
          $meta_boxes[] = [
              'title'          => __( 'My Meta Box', 'project-name' ),
              'id'             => 'my-meta-box',
              'settings_pages' => 'my_options',
              'fields'         => [
                  [
                      'id'        => 'enable_slider',
                      'name'      => 'Enable Slider?',
                      'type'      => 'switch',
                      'style'     => 'rounded',
                      'on_label'  => 'Yes',
                      'off_label' => 'No',
                  ],
              ],
          ];
          return $meta_boxes;
      }

      See more on docs https://docs.metabox.io/extensions/mb-settings-page/
      https://docs.metabox.io/fields/switch/

    3. The code which I use to create a custom function and hook to the action rwmb_{$meta_box_id}_after_save_post, the function will be fired after you click Save Settings on the settings page.
    add_action( 'rwmb_my-meta-box_after_save_post', function() {
        $enable_slider = rwmb_meta( 'enable_slider', ['object_type' => 'setting'], 'my_options' );
            
        if( $enable_slider ) {
            // function goes here
            echo "Enabled";
        } else {
            // function goes here
            echo "Disabled";
        }
    } );

    Hope that makes sense.

    in reply to: Fresh Install json errors #26807
    Long NguyenLong Nguyen
    Moderator

    Hi NorCal,

    Thank you for reaching out.

    Please follow the step Debugging Information here https://support.metabox.io/topic/how-to-create-a-new-topic/.

    Then share some screenshots and error logs, I will help you to investigate the issue.

    Long NguyenLong Nguyen
    Moderator

    Hi friends,

    Thank you for reaching out.

    A simple way to use Meta Box to control a custom post type which is created by CPT UI is
    - deactivate the plugin CPT UI
    - create a new post type with MB Custom Post Type with the same slug

    Get more details on this article https://metabox.io/move-custom-post-type-custom-field-data-from-pods-to-meta-box/.

    Long NguyenLong Nguyen
    Moderator

    Hi Kevin,

    Thank you for reaching out.

    You can hook a function to the action rwmb_{$meta_box_id}_after_save_post with the latest meta box register on the settings page. After saving the value of this meta box, the custom function will be fired.

    Get more details in the documentation
    https://docs.metabox.io/actions/#rwmb_after_save_post
    https://docs.metabox.io/extensions/mb-settings-page/#getting-field-value

    in reply to: Transform url custom field into a button #26793
    Long NguyenLong Nguyen
    Moderator

    Hi Sara,

    Thank you for contacting us.

    For example, you can wrap the field value in a <a> tag and a <button> tag to make the button clickable.

    <a href="<?php echo rwmb_meta( 'field_URL_id' ); ?>">
        <button>Click me!</button>
    </a>

    Please follow this documentation to know how to output the field value https://docs.metabox.io/displaying-fields/.

    in reply to: 2 doubts about CPTS and Taxonomy urls #26792
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for reaching out and feedback.

    The extension MB Custom Post Type does not cover two points that you mention. I'm going to inform the development team to consider adding it to the roadmap for developing this extension.

Viewing 15 posts - 3,571 through 3,585 (of 4,839 total)