Meta Field Block – Display Custom Fields for ACF, Meta Box and More
This single-block plugin allows you to display custom fields, shortcode as blocks in the Block Editor. It supports custom fields for posts, terms, and users. It can be nested inside a parent block that has postId and postType context, such as Query Loop, WooCommerce Product Collection, Term Query, or used as a stand-alone block. You can display any field whose value can be retrieved by the core API (get_post_meta, get_term_meta, get_user_meta) and is a string or can be converted to a string. To display the field value in the Block Editor, it has to be accessible via the REST API or have the field type set to dynamic. You can also display custom fields created by the Advanced Custom Fields or Meta Box plugin explicitly. It supports all ACF field types and Meta Box field types whose values are strings or can be converted to strings. Some other ACF complex fields such as Image, Link, Page Link, True False, Checkbox, Select, Radio, Button Group, Taxonomy, User, Post Object and Relationship field types as well as Meta Box fields such as Select, Checkbox, Radio, Image, Video, Taxonomy, User, Post field types are also supported in basic formats. This plugin also provides developer-friendly hook APIs that allow you to easily customize the output of the block, display complex data type fields, or use the block as a placeholder to display any kind of content with object_id and object_type as context parameters. An edge case where this block is really helpful is when you need to get the correct post_id in your shortcode when you use it in a Query Loop. In that case, you can set the field type as dynamic and input your shortcode in the field name. The block will display it correctly on both the front end and the editor. Alternatively, if you only want to see the preview of your shortcode in the editor, you can also use this block as a better version of the core/shortcode. To quickly learn how this block displays custom fields, watch the short guide (for MFB version 1.3.4) by Paul Charlton from WPTuts. The video focuses on the Advanced Custom Fields plugin, but you can use a similar approach to display fields from other frameworks like Meta Box. Links Website How it works & tutorials MFB PRO What is the HTML output of a custom field? The HTML output of a custom field on the front end depends on the context of the field. It uses one of these core API functions to get the field value: get_post_meta, get_term_meta, get_user_meta. What is the HTML output of ACF fields? All basic field types that return strings or can cast to strings are supported – The HTML output is from the get_field function. Link type – The HTML output is: {title} There is no rel attribute if the target is not _blank Image type – The HTML output is from the wp_get_attachment_image function. The image size is from the Preview Size setting. True / False type – The HTML output is Yes if the value is true, and No if the value is false. Below is the code snippet to change these text values: add_filter( 'meta_field_block_true_false_on_text', function ( $on_text, $field_name, $field, $post_id, $value ) { return 'Yep'; }, 10, 5 ); add_filter( 'meta_field_block_true_false_off_text', function ( $off_text, $field_name, $field, $post_id, $value ) { return 'Noop'; }, 10, 5 ); Checkbox / Select type – The HTML output is: {item_value} , {item_value} The item_value can be either value or label, depending on the return format of the field. Multiple selected values are separated by ,. Below is the code snippet to change the separator: add_filter( 'meta_field_block_acf_field_choice_item_separator', function ( $separator, $field_name, $field, $post_id, $value ) { return ' | '; }, 10, 5 ); Radio button / Button group type – The HTML output can be either value or label, depending on the return format of the field. Page link type, Post object type – The HTML output for a single-value field is: {title} For a multiple-value field is: {title} {title} Relationship type – The HTML output is: {title} {title} Taxonomy type – The HTML output is: {term_name} {term_name} User type – The HTML output for a single-value field is: {display_name} For a multiple-value field is: {display_name} {display_name} For other complex field types, you can generate a custom HTML output by using the hook: apply_filters( 'meta_field_block_get_acf_field', $field_value, $post_id, $field, $raw_value, $object_type ) Or by using the general hook: apply_filters( 'meta_field_block_get_block_content', $content, $attributes, $block, $object_id, $object_type ) What is the HTML output of Meta Box fields? Similar to ACF fields, all basic fields that return strings or can cast to strings using the function rwmb_get_value are supported. The HTML output of cloneable basic fields is: {item_1_value} , {item_2_value} Use the following hooks to change the tag and the separator: apply_filters( 'meta_field_block_mb_clone_field_item_separator', ', ', $field, $post_id, $field_value ) apply_filters( 'meta_field_block_mb_clone_field_item_tag', 'span', $field, $post_id, $field_value ) Single image types – The HTML output is from the wp_get_attachment_image function. The image size is from the image_size setting. Image list types (Image, Image advanced, Image upload) – The HTML output is: Checkbox / Switch type – Similar to ACF True / False type. Multi-choice types (Select, Select advanced, Button group, Autocomplete, Image select, Checkbox list) – The HTML output is: {item_value} , {item_value} To display the label instead of the value, use this hook: apply_filters( 'meta_field_block_mb_field_choice_item_display_label', false, $field_name, $field, $post_id, $value ) To change the separator, use this hook: apply_filters( 'meta_field_block_mb_field_choice_item_separator', ', ', $file_name, $field, $post_id, $value ) Radio type – The output is the field value by default. To display label or change the separator, use the same hooks as the multi-choice types. Post type – The HTML output for a single-value field is: {title} For a multiple-value field is: {title} {title} Taxonomy, Taxonomy advanced type – The HTML output for a single-value field is: {term_name} For a multiple-value field is: {term_name} {term_name} User type – Similar to ACF User type Video type – The HTML output for a single-value field is: For a multiple-value field is: To display complex field types or change the output of a field, use the hook meta_field_block_get_mb_field or the general hook meta_field_block_get_block_content. Copy & paste snippets When using the meta_field_block_get_block_content hook to customize block content, we recommend selecting dynamic as the field type. This way, both the front end and the editor will show the changes. If you are working with ACF Fields, we suggest using the meta_field_block_get_acf_field hook to modify the field content. Similarly, Meta Box users should use the meta_field_block_get_mb_field hook to modify the content. ACF snippets can also be used with Meta Box fields, but you must use the correct hook name and replace the get_field function with the rwmb_get_value function. How to change the HTML output of the block? Using the meta_field_block_get_block_content hook: add_filter( 'meta_field_block_get_block_content', function ( $block_content, $attributes, $block, $post_id, $object_type ) { $field_name = $attributes['fieldName'] ?? ''; if ( 'your_unique_field_name' === $field_name ) { $block_content = 'new content'; } return $block_content; }, 10, 5); Using the meta_field_block_get_acf_field hook for ACF Fields only: add_filter( 'meta_field_block_get_acf_field', function ( $block_content, $post_id, $field, $raw_value, $object_type ) { $field_name = $field['name'] ?? ''; if ( 'your_unique_field_name' === $field_name ) { $block_content = 'new content'; } return $block_content; }, 10, 5); This basic snippet is very powerful. You can use it to display any fields from any posts, terms, users or setting fields. Please see the details in the below use cases. How to wrap the block with a link to the post within the Query Loop? Using the meta_field_block_get_block_content hook: add_filter( 'meta_field_block_get_block_content', function ( $block_content, $attributes, $block, $post_id ) { $field_name = $attributes['fieldName'] ?? ''; if ( 'your_unique_field_name' === $field_name && $block_content !== '' ) { $block_content = sprintf(' %2$s ', get_permalink($post_id), $block_content); } return $block_content; }, 10, 4); Using the meta_field_block_get_acf_field hook for ACF Fields only: add_filter( 'meta_field_block_get_acf_field', function ( $block_content, $post_id, $field, $raw_value ) { $field_name = $field['name'] ?? ''; if ( 'your_unique_field_name' === $field_name && $block_content !== '' ) { $block_content = sprintf(' %2$s ', get_permalink($post_id), $block_content); } return $block_content; }, 10, 4); This snippet only works with the block that has only HTML inline tags or an image. How to display an image URL field as an image tag? Using the meta_field_block_get_block_content hook: add_filter( 'meta_field_block_get_block_content', function ( $block_content, $attributes, $block, $post_id ) { $field_name = $attributes['fieldName'] ?? ''; if ( 'your_image_url_field_name' === $field_name && wp_http_validate_url($block_content) ) { $block_content = sprintf(' ', esc_attr($block_content)); } return $block_content; }, 10, 4); Using the meta_field_block_get_acf_field hook for ACF Fields only: add_filter( 'meta_field_block_get_acf_field', function ( $block_content, $post_id, $field, $raw_value ) { $field_name = $field['name'] ?? ''; if ( 'your_image_url_field_name' === $field_name && wp_http_validate_url($block_content) ) { $block_content = sprintf(' ', esc_attr($block_content)); } return $block_content; }, 10, 4); How to display multiple meta fields in a block? For example, we need to display the full name of a user from two meta fields first_name and last_name. add_filter( 'meta_field_block_get_block_content', function ( $block_content, $attributes, $block, $post_id ) { $field_name = $attributes['fieldName'] ?? ''; if ( 'full_name' === $field_name ) { $first_name = get_post_meta( $post_id, 'first_name', true ); $last_name = get_post_meta( $post_id, 'last_name', true ); // If the meta fields are ACF Fields. The code will be: // $first_name = get_field( 'first_name', $post_id ); // $last_name = get_field( 'last_name', $post_id ); $block_content = trim("$first_name $last_name"); } return $block_content; }, 10, 4); Choose the field type as dynamic and input the field name as full_name. How to display a setting field? For example, we need to display a setting field named footer_credit on the footer template part of the site. add_filter( 'meta_field_block_get_block_content', function ( $block_content, $attributes, $block, $post_id ) { $field_name = $attributes['fieldName'] ?? ''; // Replace `footer_credit` with your unique name. if ( 'footer_credit' === $field_name ) { $block_content = get_option( 'footer_credit', '' ); // If the field is an ACF Field. The code will be: // $block_content = get_field( 'footer_credit', 'option' ); } return $block_content; }, 10, 4); How to use MFB as a placeholder to display any kind of content? SAVE YOUR TIME WITH MFB PRO To display simple data type fields for posts, terms, and users, you only need the free version of MFB. MFB Pro can save you 90% of development time when working with ACF, or Meta Box complex fields. It achieves this by transforming your ACF complex field types into container blocks, which work similarly to core container blocks. This eliminates the need for creating custom blocks or writing custom code for displaying complex fields. Below are some video tutorials that demonstrate how MFB Pro can help you display complex fields: How to build a post template to display dynamic data without coding How to display ACF Repeater fields as a list, grid, or carousel How to display ACF Gallery fields as a grid, masonry, or carousel The main features of MFB PRO are: Display settings fields. Display ACF advanced layout fields: Group, Repeater, and Flexible content. Display ACF Repeater fields in a carousel layout, which is useful for displaying banner sliders. Display ACF Repeater fields in an accordion layout, which is useful for displaying FAQ pages. Display ACF Relationship and Post Object fields as a Query Loop. Display the ACF Image field as a core image block. Display the ACF Gallery field as an image gallery using grid, masonry, or carousel layouts. Display the ACF File field as a video block, an image block, a button block, or a link. Display the ACF Link field as a button block. Display the ACF URL field as an image block, a button block, a link, a video block, or an embed block. Display the ACF Email field as a button block or a link. Display the ACF oEmbed field as an embed block. Display the ACF Google Map field. All Meta Box field types that correspond to ACF field types support the same Pro features as ACF. Display the Meta Box Group field, similar to the ACF Group field. Display the Meta Box Cloneable Group field as a repeater block, similar to the ACF Repeater field. Supports row, stack, grid or carousel layouts. Display the Meta Box Post field as a Query Loop. Display the Meta Box single image field as an image block, and the image list field as an image gallery using grid, masonry, or carousel layouts. Display the Meta Box File single input field as a video block, an image block, or a button. Display a group field as a details block, and display a repeater or cloned group as an accordion. Set a single image sub-field (ACF Image or Meta Box Image) as the background image of a group field. Display custom fields from a specific post, term or user. Display a taxonomy field as a Terms Query block. Display a repeater or cloned group field as an core/accordion block. Since version 1.5.3, MFB Pro allows you to bind custom fields (ACF, Meta Box, core meta fields, and core settings) directly to core blocks (Heading, Paragraph, Button, Image, Video, Embed, and the background image/video/embed of Cover block). For more complex field types (Group, Repeater, Flexible Content), you can use MFB Pro to display the group as a container. Nested fields can then be displayed using the Sub Field Block, as before, or bound directly to core blocks. If this plugin is useful for you, please do a quick review and rate it on WordPress.org to help us spread the word. I would very much appreciate it. Please check out my other plugins if you’re interested: Content Blocks Builder – Build custom layouts and blocks visually in the Block Editor without needing a code editor, using only core blocks and native Gutenberg features. SVG Block – A block to display SVG images as blocks. Useful for images, icons, dividers, and buttons. It allows you to upload SVG images and load them into the icon library. Icon separator – A tiny block just like the core/separator block but with the ability to add an icon. Breadcrumb Block – A simple breadcrumb …
Top keywords
- field151×5.93%
- block119×4.67%
- display52×2.04%
- content47×1.85%
- acf44×1.73%
- name43×1.69%
- fields41×1.61%
- block content39×1.53%
- meta39×1.53%
- post36×1.41%
- image35×1.37%
- value30×1.18%
Video Gallery Block – showcase your videos in a filterable gallery
Turn scattered YouTube and Vimeo videos into a beautiful, filterable gallery your visitors can browse and play in a lightbox – no code required. Video Gallery Block | Pricing | Support | Demo Why Video Gallery Block? Video Gallery Block is a lightweight WordPress video gallery plugin that lets you create responsive video galleries, YouTube galleries, Vimeo galleries, and video collections directly inside the Gutenberg block editor. Organize videos into albums, let visitors filter by category, and play everything in an elegant lightbox popup. Thumbnails are generated automatically (or upload your own poster images), captions keep every video labeled, and scripts load only when the block is used so your site stays fast. The Pro version adds self-hosted HTML5 and Wistia sources plus advanced layouts like sliders, carousels, masonry grids, and playlist galleries – ideal for video portfolios, product galleries, training libraries, and course videos. Free Features Responsive Video Gallery Block: Clean grid layouts that automatically adapt to desktop, tablet, and mobile screens. Album & Filter System: Organize videos into albums and let visitors filter by category. Responsive Column Layouts: Set different column numbers for desktop, tablet, and mobile. Multiple Video Sources: Add videos from YouTube and Vimeo (Wistia & self-hosted HTML5 supported in Pro). Custom Styling Controls: Adjust spacing, padding, borders, backgrounds, and shadows from the block settings. Automatic or Custom Thumbnails: Auto-generate thumbnails or upload custom poster images. Video Captions: Add captions or titles to each video in the gallery. Lightbox Video Popup: Play videos in an elegant popup lightbox. Bulk Import: Paste a list of video links, one per line, and the gallery fills itself in — titles and posters come from YouTube and Vimeo automatically, with no API key to set up. Thumbnail Shape: Lay tiles out as 16:9, 4:3, 1:1 or 9:16 for vertical Shorts and Reels, instead of a fixed pixel height. Video SEO Markup (free): Every video is described to Google and AI search with Schema.org VideoObject JSON-LD, so your gallery can appear as a video result. Comparable plugins sell this as a premium add-on. Ready-Made Section Patterns: Five fully configured patterns in the inserter — Video gallery with album filters, Course video library, Product demo showcase, Customer video stories, and Portfolio showreel wall — so you start from a finished layout, not a blank block. Show / Hide Filter Bar: A dedicated toggle to show or hide the album filter buttons. Cached Thumbnails: YouTube and Vimeo thumbnails are downloaded into your Media Library once and served from your own site after that — no third-party request on every page view, and no more thumbnails that go missing when a provider reshuffles its sizes. Load More Pagination: Set how many videos show at first; a Load More button reveals the rest, so a large gallery doesn’t overwhelm the page on first paint. YouTube Shorts Filter: Show every video, hide Shorts, or show only Shorts — detected from the link itself, no API key needed. Play Icon on Thumbnails: A play icon over every tile, so it reads as a video before anyone hovers or clicks — color, size, and the hover zoom are all customizable, or turn it off entirely. Item Border & Shadow: Round the corners and add a drop shadow to each thumbnail tile, independent of the gallery container’s own border and shadow. Server-Side Rendered: The gallery is built on the server, so search engines and visitors see it instantly — even on sites that delay JavaScript (WP Rocket, LiteSpeed, Perfmatters). Optimized Script Loading: Scripts load only when the block is used, keeping your site fast. Translation Ready: Fully compatible with multilingual websites. Sort Order: Show videos in the order you added them, or automatically sort by Newest First / Oldest First — no need to re-order videos by hand after a Bulk Import. Row Alignment: Control how a leftover row (one that doesn’t fill every column) lines up — left, center, or right — instead of it always being stretched or left stranded on one side. Per-Device Column & Row Gap: Set the spacing between tiles separately for desktop, tablet, and mobile, the same way column counts already work per device. Facebook Video Support: Add Facebook videos to the gallery alongside YouTube and Vimeo, using Facebook’s public embed — no app or API key required. GDPR Consent-Gated Embeds: Optionally require a visitor’s consent before any YouTube, Vimeo, or Facebook player loads, so the gallery doesn’t set third-party cookies until someone agrees to watch. Google Analytics 4 Video Tracking: Send a video_start event (with title, provider, and URL) to window.dataLayer whenever a visitor plays a video — works with GA4 or Google Tag Manager already on the site, nothing extra to configure. Pro Version Video Gallery Block Pro extends the plugin with additional Gutenberg video blocks and advanced gallery layouts. Pro features include: 31 Premium Video Blocks: Video Slider, Carousel, Playlist Gallery, Masonry Video Grid, Lightbox Video Gallery, Parallax Row Video Gallery, Slider Autoplay Video, Video Testimonial Section, Video Podcast Episodes, Video Stories, Video Shorts Reel, Video Showcase Wall, Video Curriculum Accordion, Video Hotspot Scene, Video Tabs Gallery, Video Scrollytelling Showcase, Video Timeline Gallery, Video Bento Grid, Video Comparison Gallery, Video Justified Gallery, Video Expanding Panels, Video Wall with Floating Player (PiP), Video Swipe Deck, Video Marquee Wall, Video Flip Cards Gallery, Video Map Gallery, Video Property Tour Gallery, Video Workout Planner, Video Wedding Story Gallery, Video Menu Showcase, and Video Feature Tour. Masonry & Mixed Ratio Layouts: Dynamic masonry galleries and mixed aspect ratio grids. Video Sliders & Carousels: Interactive sliders with autoplay and navigation controls. Playlist Video Gallery: Organized playlists with navigation and sequential playback. Parallax Video Sections: Background video sections with parallax scrolling effects. Advanced Typography & Overlays: Customize titles, captions, and overlay effects per video. Custom Navigation & Player Controls: Control slider navigation, autoplay, and player interactions. WooCommerce Video Product Carousel: Show product videos in carousel layouts for WooCommerce stores. Priority Support: Faster assistance and updates. Try the Video Gallery Block – Unlock all premium features now! How to Use Open any page or post in the WordPress block editor (Gutenberg). Click the + (Add Block) button and search for Video Gallery Block, then insert it. Add video URLs from YouTube or Vimeo in the block settings panel. Create albums for filtering, adjust columns and layout, and customize styling; enable or disable filter buttons. Preview the page on different devices, then publish. Using Premium Blocks: The Pro blocks (Video Slider, Parallax Row and the rest) come with the Pro plugin — install and activate it and they appear in the inserter alongside the free block. To see what they do first, use the Check Pro Version button in the block toolbar, or browse the live demos. Live Demo | Get Video Gallery Block PRO Use Cases Video Portfolios: Present your creative work in filterable galleries. Product Video Galleries: Showcase demos and product videos, including WooCommerce carousels (Pro). YouTube & Vimeo Collections: Curate channel content into organized albums. Training Libraries & Courses: Group lessons into albums, playlists, and curriculum accordions (Pro). Blog Video Galleries: Collect your embedded videos in one browsable place. Feedback Did you like this plugin? Dislike it? Do you have a feature request? Please share your feedback with us Check Out The Parent Plugin of This Plugin- B Blocks – A blocks collection and page building tool for Gutenberg. Related Plugins Other plugins by our team: Html5 Video Player – Display videos as single and playlist in multiple skins. PDF Poster – Display/Embed PDF files with different styles. Html5 Audio Player – Listen audios with awesome visuals. StreamCast – Customizable radio player with different skins. 3D Viewer – Embed 3D models and 3D products with interaction. Advanced Post Block – Show posts and custom posts in different layouts. Source Code The non-minified source code for this plugin is available on our public repository: GitHub Repository Third-Party Libraries This plugin uses the following third-party libraries: plyr – MIT License (bundled at public/js/plyr.js, powers the video player UI). Isotope – GPL-3.0 License (bundled at public/js/isotope.pkgd.min.js, powers video filtering and grid layouts). bpl-tools Source / GitHub: https://github.com/bPlugins/bpl-tools License: GPL-2.0-or-later – https://www.gnu.org/licenses/gpl-2.0.html Purpose: Shared utility library providing admin dashboard components and common Gutenberg editor controls. External Services: The library may connect to bPlugins, WordPress.org, and Freemius services for product data and checkout functionality. See full details: https://github.com/bPlugins/bpl-tools#external-requests–why-they-are-made As the external service functionality is handled by bpl-tools as a third-party library, the following services are utilized: bPlugins API Service URL: https://api.bplugins.com Purpose: The plugin’s admin dashboard fetches product comparison data and pricing information to display relevant upgrade options and feature details. Data Sent: Only the plugin slug is transmitted; no personal or site data is collected. Terms of Service: https://bplugins.com/terms-of-service/ Privacy Policy: https://bplugins.com/privacy-policy/ WordPress.org Plugins API Service URL: https://api.wordpress.org/plugins/info/1.2/ Purpose: The admin dashboard queries the official WordPress.org Plugins API to retrieve and display a curated list of other plugins by the same author (“Our Plugins” section). Data Sent: Plugin slugs and author name; no personal or site data is collected. Terms of Service: https://wordpress.org/about/tos/ Privacy Policy: https://wordpress.org/about/privacy/ Freemius API Service URL: https://api.freemius.com Purpose: Handles license activation, premium feature verification, update checks, and opt-in telemetry for both free and pro versions. Data Sent: Site URL, admin email, license keys, and version numbers. Terms of Service: https://freemius.com/terms/ Privacy Policy: https://freemius.com/privacy/ Build Process This plugin uses a build process to generate the production assets (JS/CSS) located in the build/ directory. The human-readable source code is available in the src/ directory. To build the plugin from source: 1. Clone the repository: https://github.com/bPlugins/video-gallery-block-free 2. Install dependencies: npm install 3. Run the build command: npm run build Build Tools Used: Webpack, Babel, PostCSS, Gulp.