Forum Replies Created
-
AuthorPosts
-
October 28, 2026 at 6:17 PM in reply to: MB Relationships loses source IDs when processed query arguments are reused #50251
Stephen Walker
ParticipantThe workaround
/** * Plugin Name: Meta Box and WP Grid Builder relationship compatibility * Description: Automatically restores registered Meta Box relationship sources in copied WP Grid Builder post queries, including AND/OR combinations. * Version: 0.2.0 */ defined('ABSPATH') || exit; final class MB_WPGB_Relationship_Compat { /** Repair only normalized clauses belonging to registered relationships. */ public static function restore_clause($args) { if (!is_array($args) || !is_string($args['id'] ?? null)) return $args; // Preserve fresh arguments, including explicitly supplied source IDs. if (isset($args['from']) || isset($args['to'])) return $args; $direction = $args['direction'] ?? ''; if (!in_array($direction, ['from', 'to'], true) || !isset($args['items']) || !is_array($args['items'])) return $args; $relationship = MB_Relationships_API::get_relationship($args['id']); if (!$relationship || ($args['id_field'] ?? null) !== $relationship->get_db_field($direction)) return $args; $args[$direction] = $args['items']; return $args; } /** Meta Box 1.14.0 supports a single clause or one flat AND/OR group. */ public static function restore($args) { if (!class_exists('MB_Relationships_API') || !is_array($args)) return $args; if (!isset($args['relation'])) return self::restore_clause($args); if (!in_array($args['relation'], ['AND', 'OR'], true)) return $args; foreach ($args as $key => $clause) { if ($key !== 'relation') $args[$key] = self::restore_clause($clause); } return $args; } public static function repair_query(WP_Query $query) { if (!class_exists('MB_Relationships_API')) return; // WPGB removes wp_grid_builder after filtering but retains wpgb_inject // when copying the query to calculate facet choices and counts. $grid = $query->get('wp_grid_builder') ?: $query->get('wpgb_inject'); if (!is_scalar($grid) || empty($grid)) return; $args = $query->get('relationship'); $restored = self::restore($args); if ($restored !== $args) $query->set('relationship', $restored); } } // MB Relationships 1.14.0 parses post queries at priority 20. add_action('parse_query', [MB_WPGB_Relationship_Compat::class, 'repair_query'], 19);Stephen Walker
ParticipantAt this point (AIO 2.2.1), no. I am not sure why it started happening. The only other item I know that uses the legacy editor in these sites is Bricks Builder for the Rich Text element, but there are no problems with that.
April 19, 2025 at 11:02 PM in reply to: Tabs won't work after changing tab style in a field group settings #48106Stephen Walker
ParticipantI just installed the so-called fix (2.1.1), and now the tab panels do not show. The display:none is not removed when the tab is active.
June 20, 2024 at 4:35 PM in reply to: How to use Metabox to create custom fields within Menu items #45671Stephen Walker
ParticipantIs this still being developed?
Stephen Walker
ParticipantAny plans to add this functionality? It seems essential for any field that allows you to upload to the server. Your primary competitor has had it for at least five years, and this may force me to go to that product (just saying).
Stephen Walker
ParticipantJust chiming in that this is impacting multiple sites for me as well. Looking forward to a fix.
Stephen Walker
ParticipantThank you for the information. The setting within the network section was the key.
-
AuthorPosts