Support Forum » User Profile

Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: std value not loading with block #49602
    Paul WenzelPaul Wenzel
    Participant

    Update: Changing the category options type from taxonomy to taxonomy_advanced fixed the issue.

    in reply to: std value not loading with block #49601
    Paul WenzelPaul Wenzel
    Participant

    Okay, after some back and forth:

    The taxonomy_terms_category is the culprit, but I can't figure out why.

    'fields' => [
                [
                    'id' => $block_prefix . 'posts_per_page',
                    'name' => 'Number of Posts',
                    'type' => 'number',
                    'std' => 5,
                    'min' => 1,
                    'max' => 12,
                ],
                $fields['custom_name']['custom_name_text'],
                $fields['custom_name']['show_name_on_frontend'],
                [
                    'id' => $block_prefix . 'include_images',
                    'name' => 'Include Images in Lower Posts',
                    'type' => 'switch',
                    'style'     => 'rounded',
                    'off_label' => 'No',
                    'on_label'  => 'Yes',
                    'std' => 'No',
                ],
                
            'auto_pull' => [
                'id' => $block_prefix . 'auto_pull',
                'name' => 'Auto Pull',
                'type' => 'radio',
                'options' => [
                    '' => 'None',
                    'category' => 'Category',
                    'tag' => 'Tag',
                ],
            ],
            'taxonomy_terms_category' => [
                'id' => $block_prefix . 'taxonomy_terms_category',
                'name' => 'Category',
                'type' => 'taxonomy',
                'taxonomy' => ['category'],
                'field_type' => 'select_advanced',
                'placeholder' => 'Select category',
                'multiple' => false,
                'hidden' => [$block_prefix . 'auto_pull', '!=', 'category'],
    
            ],
            'taxonomy_terms_tags' => [
                'id' => $block_prefix . 'taxonomy_terms_tags',
                'name' => 'Tag',
                'type' => 'taxonomy',
                'taxonomy' => ['post_tag'],
                'field_type' => 'select_advanced',
                'placeholder' => 'Select tag',
                'multiple' => false,
                'query_args' => [
                    'hide_empty' => true,
                    'number' => 0
                ],
                'hidden' => [$block_prefix . 'auto_pull', '!=', 'tag'],
    
            ],

    If I remove that, it works fine. Any other combination without that works fine, and any combination with that breaks the number_of_posts std (and the std on other fields if I set it, like in include images...)

    Any idea why?

    Paul WenzelPaul Wenzel
    Participant

    I was able to solve the issue by passing 'post_type' => 'episode' with my WP_Query call noted above.

    It now looks like this:

    $connected = new WP_Query( [
      'relationship' => [
        'id'   => 'podcasts_to_episodes',
        'from' => get_the_ID(), // You can pass object ID or full object
      ],
      'orderby' => 'date',
      'order' => 'DESC',
      'paged' => $paged,
      'post_status' => 'publish',
      'post_type' => 'episode'
    ] );

    I wasn't using this before, but it looks like that resolves my issue. The post_type parameter appears to be required after this change in inc/query/post.php, introduced in MB Relationships 1.10.6:

    https://github.com/wpmetabox/mb-relationships/commit/e48e19322b4d9e13e3942c78fd27278a311e8080

    Paul WenzelPaul Wenzel
    Participant

    Here's some snippets from my Podcast to Episodes relationship. As far as I can tell, this part continues to work fine in the last few updates of Meta Box AIO. Something is different about the way related posts are queried, however.

    
    // register relationship
    add_action('mb_relationships_init', array($this,'podcasts_to_episodes_relationship'));
    
    function podcasts_to_episodes_relationship () {
        MB_Relationships_API::register( array(
            'id'   => 'podcasts_to_episodes',
            'reciprocal' => true,
            'from' => array(
                'object_type'  => 'post',
                'post_type'    => 'episode',
                'admin_column' => true,
                'meta_box'     => [
                    'title' => 'Podcast',
                ],
            ),
            'to' => array(
                'object_type'  => 'post',
                'post_type'    => 'podcast',
                'admin_column' => false,
            ),
        ));
    }
    
    ...
    
    // link episode id to podcast id
    MB_Relationships_API::add( $episode_id, $podcast_id, 'podcasts_to_episodes');
    Paul WenzelPaul Wenzel
    Participant

    I still see a broken alpha color picker in the Customizer when using Meta Box 5.3.4. The color picker works fine in the regular WordPress admin, but not in the Customizer.

    I added this to my functions.php file to work around the issue:

    if( is_customize_preview() ) {
      add_action( 'wp_default_scripts', 'wp_default_custom_scripts' );
      function wp_default_custom_scripts( $scripts ) {
        $scripts->add( 'wp-color-picker', '/wp-admin/js/color-picker.js', array( 'iris' ), false, 1 );
        did_action( 'init' ) && $scripts->localize(
          'wp-color-picker',
          'wpColorPickerL10n',
          array(
            'clear'            => __( 'Clear' ),
            'clearAriaLabel'   => __( 'Clear color' ),
            'defaultString'    => __( 'Default' ),
            'defaultAriaLabel' => __( 'Select default color' ),
            'pick'             => __( 'Select Color' ),
            'defaultLabel'     => __( 'Color value' ),
          )
        );
      }
    }
    Paul WenzelPaul Wenzel
    Participant

    Hi, I performed some additional tests with MB Settings 2.12.

    Here's what I found working and not working with Customizer Drafts created with MB Settings:

    1. Saving colors as a draft works. For example, I set our theme's navigation colors to all red.
    2. Sharing my newly drafted colors via the preview link also works. I tested the "Share Preview Link" in Chrome Incognito and saw my drafted red navigation colors.

    BUT:

    If you close the Customizer and return, your drafted settings no longer appear and you have to recreate them.

    I also tried returning to the Customizer when logged in via the shared preview link, but the drafted changes still appeared lost in the admin UI.

    We are using Meta Box AIO 1.11.18, MB Settings 2.12, and Meta Box 5.3.3.

    Let me know if I need to instantiate our settings page with any special options, or if this is a bug.

    Thanks!

    Paul WenzelPaul Wenzel
    Participant

    This update appears to have fixed the issue. Thanks!

    Paul WenzelPaul Wenzel
    Participant

    Still wondering about this feature. Any update is appreciated. Thanks!

    Paul WenzelPaul Wenzel
    Participant

    Hello. Any update on this bug?

    Thanks!

    Paul WenzelPaul Wenzel
    Participant

    This is an important feature that is missing. Please let me know when it is fixed.

    Paul WenzelPaul Wenzel
    Participant

    Yes, they do show when selected, however, if you use the "Share Preview Link" in a different window, do you actually see your saved changes?

Viewing 11 posts - 1 through 11 (of 11 total)