Jun
4

AutoMedia Inserter

06/04/2025 12:00 AM by Publisher in Wordpress


๐Ÿ“ฅ AutoMedia Inserter – Smart Media Embedder for WordPress

AutoMedia Inserter is a powerful and flexible WordPress plugin that allows you to automatically insert audio, video, or image players into posts based on keywords found in the post title. Ideal for blogs with rich multimedia content such as audio stories, video episodes, or image-based documentation.


๐Ÿš€ Key Features

  • ๐Ÿ” Detects keywords in post titles and embeds associated media automatically

  • ๐ŸŽง Supports audio, video (MP4, YouTube, Vimeo), and image formats

  • ๐ŸŽš๏ธ Choose media placement: top, center, bottom, or mixed

  • ๐Ÿ” Inline editing of media entries

  • โŒ Remove or temporarily disable entries without deleting them

  • ๐Ÿ”„ Import & Export media rules via JSON

  • ๐Ÿ“ฑ Fully responsive admin table layout with live search and pagination

  • ๐Ÿ’พ Data stored safely in WordPress options (no custom tables)


๐Ÿ–ฅ๏ธ How It Works

The plugin reads the post title and compares it against a list of keywords defined by the admin. If a match is found, it automatically embeds the associated media (audio, video, or image) directly into the post content at the chosen position.


๐Ÿงฑ Admin Interface Breakdown

1. Settings Page (settings-page.php)

Handles:

  • Displaying the list of keyword-media rules in a responsive table

  • Allowing inline edit, disable/enable toggle, and delete

  • Export to JSON (button with JS handler)

  • Import from JSON (form with file input)

  • Live search and per-page filter

  • Saving the full configuration via POST

Code Explanation:

if (isset($_POST['automedia_submit'])) {
    // Sanitizes and saves each entry
    $saved[] = [
        'keyword' => sanitize_text_field($kw),
        'url' => esc_url_raw($urls[$i]),
        'type' => sanitize_text_field($types[$i]),
        'active' => isset($actives[$i]) && $actives[$i] == '1' ? 1 : 0
    ];
}

2. Content Injection (insert-player.php)

Hooks into the_content and injects the media player based on matching keywords.

add_filter('the_content', function ($content) {
    if (stripos($content, $e['keyword']) !== false) {
        $media_output .= "<iframe src='{$url}'></iframe>"; // example
    }
    return $media_output . $content;
});

It supports:

  • YouTube and Vimeo via iframe

  • Local videos (MP4, WebM, OGG)

  • Audio (MP3)

  • Images (JPG, PNG, etc.)

Disabled entries are skipped.

3. JavaScript (admin.js)

Handles dynamic admin behavior:

  • Inline edit, cancel, delete, and disable/enable toggling

  • Filtering rows based on search input

  • Pagination logic

  • JSON export generation

4. CSS (admin.css)

Keeps the admin interface readable and table-like even on mobile, without breaking into block layout:

@media screen and (max-width: 768px) {
    .automedia-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

๐Ÿ“ฆ Use Cases

  • Podcasts: Auto-embed the right episode in matching post

  • Audio stories: Play a story when title matches

  • Video lessons or tutorials

  • Museum image displays by keyword

  • SEO-enhanced media experience


Author

Nicuศ™or Gurฤƒu
WP Plugins URI: https://webmastertool.org/blog/category/wordpress


 

๐Ÿ“Ž Download Now

๐Ÿ‘‰ Download AutoMedia Inserter Plugin



leave a comment
Please post your comments here.