MyListing Video Repeater Field
The {CODICTS} MyListing Video Repeater Field plugin adds a powerful repeater-style custom field to the MyListing theme that allows listing owners to attach multiple videos to a single listing. It supports YouTube, Vimeo, Instagram, TikTok, Hudl, and self-hosted videos. When the “Attach to listing type” option is enabled, the plugin goes further — it automatically creates individual child listing posts for each video, linked to the parent listing via MyListing’s Related Listing system, enabling video-specific explore pages, filtering, and preview cards.
Requirements
| Requirement | Details |
|---|---|
| {CODICTS} Preview Cards Addon | Required for the video display block on single listing pages (provides the [codicts-video] shortcode) |
Child theme required: The plugin copies template files into the child theme for the repeater form field and display block. Without a child theme, the plugin cannot install its templates and will display an error notice.
Installation & Activation
Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.
After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.
On activation, the plugin automatically copies its template files into your child theme. Navigate to any Listing Type → Fields tab to start adding the Video Repeater field.
Key Features
| Feature | Description |
|---|---|
| Repeater Field | Listing owners can add multiple video entries per listing, each with a title, URL, optional description, and optional poster image. |
| Auto-Listing Creation | Optionally, each video entry automatically becomes its own child listing post — linked to the parent via MyListing’s Related Listing system. |
| Video URL Validation | Real-time AJAX validation for YouTube, Vimeo, Instagram, TikTok, and Hudl URLs before form submission. |
| Self-Hosted Video Support | Also supports .mp4, .webm, .ogv, and .mov files hosted on your own site. |
| Poster Image Upload | AJAX-powered image upload for each video entry as a thumbnail/poster. |
| Display Block | Carousel or Grid view block for showing videos on the single listing page. |
| Field Syncing | Automatically copy field values (e.g., categories) from the parent listing to each generated child video listing. |
| URL Locking | Optionally prevent editing of video URLs after they’ve been set, avoiding accidental changes. |
| Maximum Item Control | Limit how many videos a listing owner can add. |
| Strict Item Check | Require previous video entries to be filled before allowing new ones. |
| Lifecycle Management | Child video listings are automatically trashed when the parent is unpublished and restored when republished. |
How It Works
The plugin operates in two modes depending on whether “Attach to listing type” is enabled:
Basic Mode (Attach Disabled)
The repeater stores video data directly on the parent listing. Videos are displayed on the single listing page via the display block. No child listings are created.
Advanced Mode (Attach Enabled)
Each video entry in the repeater automatically creates a separate child listing linked to the parent. This enables video-specific explore pages, filtering, and preview cards. The full flow:
1. A listing owner adds video entries (title, URL, description, poster image) to the repeater on the add/edit listing form.
2. When the listing is saved, the plugin creates a child listing for each video entry — setting the title, video URL, description, cover image, and listing type.
3. The plugin inserts relationship rows linking the parent and child listings via MyListing’s Related Listing system.
4. If configured, additional fields (e.g., categories, tags) are synced from the parent to each child listing.
5. On the single listing page, the display block renders all videos in a carousel or grid layout.
Lifecycle Management
| Parent Action | What Happens to Child Video Listings |
|---|---|
| Parent listing is published | Child listings are created or updated for each video entry. |
| Parent listing is unpublished (pending, draft, etc.) | All child video listings are trashed. |
| Parent listing is re-published | Child video listings are restored from the saved repeater data. |
| A video is removed from the repeater | The corresponding child listing is trashed. |
Pre-Setup — Creating the Video Listing Type
If you plan to use the “Attach to listing type” feature (advanced mode), you first need a separate listing type to represent individual videos.
1. Go to Listing Types → Add New and create a new listing type (e.g., “Videos”).
2. Add the following fields to this video listing type:
| Field | Type | Notes |
|---|---|---|
| Description | Text / Textarea | Stores the video description. |
| Cover Image | File / Image | Stores the poster/thumbnail image. |
| Video URL | URL | Stores the video URL. |
| Parent Listing | Custom Text Field | Key must be mlvra-parent-listing. Hide from the submit form — populated automatically. |
| Related Listing | Related Listing | Relation Type = Belongs to One. Select the parent listing type (e.g., “Athletes”). |
3. Save the listing type.
Tip: This step is only needed for the “Attach to listing type” feature. If you only want to display videos on the listing page without creating separate child listings, skip this pre-setup.
Adding the Video Repeater Field
1. Edit your parent listing type (e.g., “Athletes,” “Profiles,” “Businesses”).
2. Navigate to the Fields tab.
3. Click the {C} Video Repeater button in the field sidebar to add the field.
4. Configure the field settings:
| Setting | Default | Description |
|---|---|---|
| Label | {C} Video Repeater | Display label for the field on the add/edit listing form. |
| Video Placeholder | Video URL | Placeholder text for the video URL input. |
| Description | (empty) | Help text shown below the field. |
| Minimum Title Length | 3 | Minimum characters required for each video’s title. |
URL Validation Toggles
| Setting | Default | Description |
|---|---|---|
| Verify YouTube Link | Off | Validates YouTube URLs via the oEmbed API before submission. |
| Verify Vimeo Link | Off | Validates Vimeo URLs via HTTP headers. |
| Verify Instagram Link | Off | Validates Instagram URL structure. |
| Verify TikTok Link | Off | Validates TikTok URL structure. |
| Verify Hudl Link | Off | Validates Hudl URL structure. |
Tip: Enable validation only for the platforms your users will submit. Self-hosted videos (
.mp4,.webm,.ogv,.mov) on the same domain are validated automatically regardless of these toggles.
Repeater Controls
| Setting | Default | Description |
|---|---|---|
| Allow Video URL Edit | Off | When off, video URLs are locked after initial entry (displayed as read-only with a lock icon). When on, URLs can be edited anytime. |
| Maximum Video Fields | 0 (unlimited) | Maximum number of videos per listing. Set to 0 for unlimited. |
| Strict Item Check | Off | When on, all previous video entries must be filled before adding a new one. |
| Hide Description | Off | Hides the description textarea from the repeater. |
| Hide Poster Image | Off | Hides the poster image upload from the repeater. |
Attach to Listing Type (Advanced Mode)
| Setting | Default | Description |
|---|---|---|
| Attach to Listing Type | Off | Enable automatic creation of child listing posts for each video entry. |
| Assign to Listing Type | (none) | The listing type slug to use for generated video listings (e.g., “videos”). Only visible when Attach is enabled. |
| Sync Additional Fields | (empty) | Comma-separated field keys to sync from parent to child listings (e.g., video_category,video_tags). Only visible when Attach is enabled. |
5. If using “Attach to listing type,” also add a Related Listing field to the parent listing type with Relation Type = Has Many and Related To = your video listing type. Optionally hide from the submit form.
6. Save the listing type.
Adding the Display Block
1. Edit the same listing type.
2. Navigate to the Single Page tab.
3. Add a new content block and select “{C} Video Repeater”.
4. Configure the block settings:
| Setting | Default | Description |
|---|---|---|
| Title | {C} Video Repeater | Section heading displayed above the video gallery (e.g., “Videos,” “Highlights”). |
| Source Field | (none) | Select the Video Repeater field to display. Only Video Repeater fields appear in this list. |
| Gallery Type | Carousel | Carousel (horizontal slider with navigation arrows) or Grid (responsive multi-column layout). |
| Columns | 3 | Number of columns for the grid or carousel display. |
5. Save the listing type.
Note: The display block requires the {CODICTS} Preview Cards Addon plugin to be installed and active. It uses the
[codicts-video]shortcode from that plugin to render videos. If the shortcode is unavailable, a notice with a link to the addon is shown instead.
Additional Field Syncing
When “Attach to listing type” is enabled, you can automatically copy field data from the parent listing to each generated child video listing. This is useful for syncing categories, tags, or other shared data.
1. Ensure both the parent and child listing types have fields with matching field keys (e.g., both have a taxonomy field keyed video_category).
2. In the Video Repeater field settings, enter the matching keys in the “Sync Additional Fields” input, separated by commas (e.g., video_category,video_tags).
3. When the parent listing is saved, each child video listing inherits the synced field values. Taxonomy fields copy the terms; all other field types copy the meta value.
Video URL Validation
When validation toggles are enabled, the plugin validates video URLs in real-time before form submission:
| Platform | Validation Method |
|---|---|
| YouTube | Extracts the video ID and verifies it exists via YouTube’s oEmbed API. |
| Vimeo | Checks the URL returns a valid HTTP response from Vimeo. |
| Validates the URL structure matches Instagram’s format. | |
| TikTok | Validates the URL contains tiktok.com. |
| Hudl | Validates the URL contains hudl.com. |
| Self-hosted | Checks the URL is on the same domain and has a valid video extension (.mp4, .webm, .ogv, .mov). |
If validation fails, the form submission is blocked and an error message is shown on the URL input. When a URL is changed, it must be re-validated before submitting.
Example Setup — Athlete Video Highlights
1. Activate the plugin (and the {CODICTS} Preview Cards Addon) with the MyListing theme and a child theme active.
2. Create a “Videos” listing type with Description, Cover Image, Video URL, Parent Listing (key: mlvra-parent-listing, hidden), and Related Listing (Belongs to One → Athletes) fields. Save.
3. Edit the “Athletes” listing type. On the Fields tab, add a {C} Video Repeater field. Configure it:
a. Set Label to “Highlight Videos.”
b. Enable Verify YouTube Link and Verify Vimeo Link.
c. Set Maximum Video Fields to 10.
d. Enable Attach to Listing Type and set Assign to Listing Type to “videos.”
4. Add a Related Listing field to the Athletes type with Relation Type = Has Many, Related To = Videos. Hide from submit form.
5. On the Single Page tab, add a “{C} Video Repeater” content block. Set the Title to “Highlight Reel,” Source Field to your Video Repeater field, Gallery Type to Carousel, and Columns to 3.
6. Save the listing type.
7. An athlete creates their profile listing and adds 5 YouTube highlight videos via the repeater — entering a title, pasting a YouTube URL (validated in real-time), and optionally adding a description and poster image for each.
8. On save, the plugin creates 5 separate “Videos” child listings, each linked to the athlete’s parent listing via the Related Listing system.
9. On the athlete’s profile page, visitors see the “Highlight Reel” section with a carousel of 5 embedded videos. The videos are also browsable on a dedicated Videos explore page with filtering.
10. If the athlete removes a video from the repeater and saves, the corresponding child listing is trashed. If the athlete’s profile is unpublished, all child video listings are trashed automatically and restored when republished.
Example Setup — Simple Video Gallery (No Child Listings)
1. Edit a listing type (e.g., “Businesses”).
2. Add a {C} Video Repeater field. Leave Attach to Listing Type disabled. Enable the YouTube and Vimeo validation toggles. Set a maximum of 5 videos.
3. Add a “{C} Video Repeater” content block on the Single Page tab. Set to Grid layout with 2 columns.
4. Save. Listing owners can now add up to 5 videos that display in a grid on their listing page — no child listings created, just a simple embedded video gallery.
Frequently Asked Questions
Does this require a child theme?
Yes. The plugin copies template files into the child theme for the repeater form field and display block. Without a child theme, the plugin cannot install its templates.
Does the display block require another plugin?
Yes. The video display block requires the {CODICTS} Preview Cards Addon to be installed and active. It uses the [codicts-video] shortcode from that plugin to render embedded videos. Without it, a notice is shown instead of the video gallery.
What video platforms are supported?
YouTube, Vimeo, Instagram, TikTok, Hudl, and self-hosted videos (.mp4, .webm, .ogv, .mov). URL validation can be enabled per-platform in the field settings.
Do I have to use the “Attach to listing type” feature?
No. With “Attach” disabled, the repeater simply stores video data on the parent listing and displays them via the content block. No child listings are created. This is simpler and suitable if you just want to show videos on the listing page.
What happens when I remove a video from the repeater?
If “Attach to listing type” is enabled, the corresponding child listing is trashed when the parent listing is saved. If “Attach” is disabled, the video data is simply removed from the parent listing’s stored data.
What happens when the parent listing is unpublished?
If “Attach to listing type” is enabled, all child video listings are automatically trashed. When the parent is republished, child listings are restored from the saved repeater data.
Can I limit how many videos users can add?
Yes. Set “Maximum Video Fields” in the field settings to your desired limit. Set to 0 for unlimited.
What does “URL Locking” do?
When “Allow Video URL Edit” is disabled (the default), video URLs become read-only with a lock icon after initial entry. This prevents listing owners from accidentally changing established video links. Enable the setting if you want URLs to always be editable.
What does “Strict Item Check” do?
When enabled, all required fields in previous video entries must be filled before a new entry can be added. This prevents users from adding empty or incomplete video entries.
How does additional field syncing work?
Enter comma-separated field keys in the “Sync Additional Fields” setting. Both the parent and child listing types must have fields with matching keys. On save, taxonomy fields copy their terms and all other field types copy their meta values from parent to child.
How do I change the delete button from an icon to text?
Add this to your child theme’s functions.php:
add_filter( 'codicts-mylisting-video-repeater-field::change-delete-buttons', '__return_true' );
Does the plugin create any database tables?
No. Video data is stored as post meta on the parent listing. Child video listings are standard job_listing posts. Relationships use MyListing’s existing wp_mylisting_relations table. No custom database tables are created.
Troubleshooting
Field Not Appearing in Listing Type Editor
| Cause | Solution |
|---|---|
| Templates not installed | Deactivate and reactivate the plugin to force-reinstall templates. Verify template files exist in your child theme’s templates/ directory. |
| Plugin not activated | Go to Plugins → Installed Plugins and verify the plugin is active. |
| MyListing or child theme not active | Both the MyListing theme and a child theme must be active. |
Videos Not Being Created as Separate Listings
| Cause | Solution |
|---|---|
| “Attach to listing type” not enabled | Enable the setting in the Video Repeater field configuration and select a target listing type. |
| Parent listing not published | Child listings are only created when the parent listing’s status is “publish.” Ensure the parent is published. |
| Video listing type not configured | Verify the video listing type exists and has the required fields (especially mlvra-parent-listing with the exact key). |
Display Block Shows “Preview Cards Addon” Notice
| Cause | Solution |
|---|---|
| Preview Cards Addon not installed | Install and activate the {CODICTS} Preview Cards Addon plugin. The display block requires its [codicts-video] shortcode to render embedded videos. |
URL Validation Failing or Too Strict
| Cause | Solution |
|---|---|
| Platform-specific behavior | YouTube uses the oEmbed API (requires server network access to youtube.com). Vimeo checks HTTP headers. Instagram, TikTok, and Hudl only validate URL structure. Self-hosted videos must be on the same domain with a valid extension (.mp4, .webm, .ogv, .mov). |
| Server can’t reach external APIs | YouTube validation requires your server to access youtube.com/oembed. Check firewall settings if YouTube validation consistently fails. |
Child Listings Not Trashed When Parent is Unpublished
| Cause | Solution |
|---|---|
| Hook conflict | The plugin uses the transition_post_status hook. Another plugin may be interfering. Try deactivating other plugins to test. |
Template Overwrite Warning
The following template files in your child theme are managed by this plugin and will be overwritten on reactivation and updates:
templates/add-listing/form-fields/video-repeater-field.php
templates/single-listing/content-blocks/video-repeater-block.php
If you’ve customized these files, back up your changes before updating the plugin or deactivating/reactivating it.
“MyListing Theme Not Detected” or “Child Theme Not Detected” Error
The MyListing theme and a child theme must both be installed and active. Go to Appearance → Themes to verify.
For further support, visit codicts.com or contact us at support@codicts.com.