=== Dynamic Video for Divi Posts ===
Contributors: hyperspective
Tags: video, dynamic, Divi, embed, shortcode
Requires at least: 5.0
Tested up to: 6.7
Stable tag: 1.0.2
License: GPL2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Short Description: Embeds videos into posts via a custom field and [dynamic_video] shortcode for Divi, with optional featured image fallback.

== Description ==
Dynamic Video for Divi Posts dynamically embeds a video into your blog posts by using a custom field. When editing a post, a new meta box labeled "Video URL" appears. Enter a video URL (e.g., a YouTube link) into this box, and then use the [dynamic_video] shortcode in your Divi Builder template. The video is automatically embedded using WordPress’s oEmbed functionality. New in version 1.0.2: Optional setting to display the post's featured image when no video URL is provided.

== Installation ==
1. Upload the plugin files to the `/wp-content/plugins/dynamic-video-for-divi-posts` directory, or install the plugin through the WordPress plugins screen by uploading the ZIP file.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Edit any post to see the "Video URL" meta box and enter your video URL.
4. In your Divi Builder template, add a Code or Text module and insert the shortcode: `[dynamic_video]`.
5. (Optional) Go to Settings > Dynamic Video for Divi Posts to enable the featured image fallback option.

== Screenshots ==
1. Settings, Instructions
2. Snippet example for Divi Code Module
3. Blog entry for video URL

== Frequently Asked Questions ==
= How do I embed a video? =
Enter a valid video URL (for example, a YouTube URL) in the "Video URL" meta box when editing a post, and then use the `[dynamic_video]` shortcode in your template. The video will be automatically embedded via WordPress’s oEmbed functionality.

= Why isn’t my video appearing? =
Ensure that the video URL is correct and that your post type supports the shortcode. Also, verify that your Divi Builder template includes the `[dynamic_video]` shortcode. If no video appears and the featured image option is enabled, check if the post has a featured image set.

= How does the featured image fallback work? =
When enabled in the plugin settings, if no video URL is provided for a post, the plugin will display the post's featured image instead of leaving the space blank. You can turn this feature on or off in the plugin settings.

== Changelog ==
= 1.0.2 =
* Added optional feature to display featured image when no video URL is provided
* Added settings page checkbox to enable/disable featured image fallback
* Updated documentation to include new feature instructions

= 1.0.1 =
* Renamed all functions, meta keys, nonce names, and admin slugs to use the unique prefix "dynvid_" to avoid naming conflicts.
* Improved nonce verification by sanitizing input using both wp_unslash() and sanitize_text_field().
* Enhanced data sanitization and output escaping for all user inputs and meta values.
* Added an admin submenu page for plugin details.
* Minor code and documentation updates for better security and compatibility.

== Upgrade Notice ==
= 1.0.2 =
This update adds an optional featured image fallback feature when no video URL is provided, with a settings toggle. Update to access this new functionality while maintaining all previous features.