Skip to content

Upload Field to YouTube for ACF is a WordPress plugin that allows you to upload videos directly to YouTube via API from the WordPress admin area

License

Notifications You must be signed in to change notification settings

frugan-dev/upload-field-to-youtube-for-acf

GitHub Downloads (all assets, all releases) GitHub Actions Workflow Status GitHub Issues PRs Welcome GitHub Release License

Upload Field to YouTube for ACF (WordPress Plugin)

Upload Field to YouTube for ACF is a WordPress plugin that allows you to upload videos directly to YouTube via API from the WordPress admin area and/or select existing videos on your YouTube channel based on playlists. It is particularly useful for managing videos that may be associated with Custom Post Types (CPT).

To use this plugin, you need to configure Google oAuth credentials so the plugin can authenticate with the user's YouTube channel.

Requirements

Features

  • direct video upload to YouTube from CPTs within the WordPress interface
  • selection of existing YouTube videos, filtered by playlists
  • support for "unlisted" video privacy, making this plugin ideal for managing private or exclusive videos tied to specific content
  • use official ACF Example Field Type
  • support for logging with Wonolog ^2.x, if available
  • made with Vanilla JS (no jQuery)
  • autoload classes with Composer and PSR-4
  • support ACF nested repeater
  • translations managed via Crowdin

Installation

You can install the plugin in three ways: manually, via Composer (wpackagist) (coming soon) or via Composer (package).

Manual Installation
  1. Go to the Releases section of this repository.
  2. Download the latest release zip file.
  3. Log in to your WordPress admin dashboard.
  4. Navigate to Plugins > Add New.
  5. Click Upload Plugin.
  6. Choose the downloaded zip file and click Install Now.
Installation via Composer "wpackagist" (coming soon)

If you use Composer to manage WordPress plugins, you can install it from WordPress Packagist:

  1. Open your terminal.
  2. Navigate to the root directory of your WordPress installation.
  3. Ensure your composer.json file has the following configuration: *
{
    "require": {
        "composer/installers": "^1.0 || ^2.0",
        "wpackagist-plugin/upload-field-to-youtube-for-acf": "^0.1"
    },
    "extra": {
        "installer-paths": {
            "wp-content/plugins/{$name}/": [
               "type:wordpress-plugin"
            ]
        }
    }
}
  1. Run the following command:
composer update

Note:
* composer/installers might already be required by another dependency.

Installation via Composer "package"

If you use Composer to manage WordPress plugins, you can install it from this repository directly:

  1. Open your terminal.
  2. Navigate to the root directory of your WordPress installation.
  3. Ensure your composer.json file has the following configuration: *
{
    "require": {
        "composer/installers": "^1.0 || ^2.0",
        "frugan-dev/upload-field-to-youtube-for-acf": "^0.1"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "frugan-dev/upload-field-to-youtube-for-acf",
                "version": "0.1.0",
                "type": "wordpress-plugin",
                "dist": {
                    "url": "https://github.com/frugan-dev/upload-field-to-youtube-for-acf/releases/download/v0.1.0/upload-field-to-youtube-for-acf.zip",
                    "type": "zip"
                }
            }
        }
    ],
    "extra": {
        "installer-paths": {
            "wp-content/plugins/{$name}/": [
               "type:wordpress-plugin"
            ]
        }
    }
}
  1. Run the following command:
composer update

Note:
* composer/installers might already be required by another dependency.

Configuration

Once installed:

  1. In your WordPress admin dashboard, navigate to the Plugins section and click Activate Plugin.
  2. Create a new field via ACF and select the YouTube Uploader type.
  3. Read the description above for advanced usage instructions.

Creating the oAuth Credentials

  1. Go to the Google API Console.
  2. Create a project or select an existing one.
  3. Navigate to the OAuth consent screen section and configure the required details to enable authentication.
  4. Then, go to Credentials and create an OAuth 2.0 Client ID.
  5. In the Authorized redirect URIs field, enter your WordPress site's callback URL (e.g., https://domain.tld/wp-admin/).
  6. Obtain the Client ID and Client Secret.

Limitations

If you use the API upload mode, please note this important notice here:

All videos uploaded via the videos.insert endpoint from unverified API projects created after July 28, 2020, will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the YouTube Terms of Service.

Setting in wp-config.php

Add the following lines to wp-config.php to define the oAuth credentials:

define('FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_ID', 'Client ID');
define('FRUGAN_UFTYFACF_GOOGLE_OAUTH_CLIENT_SECRET', 'Client Secret');

Enabling Cache Busting

If you use filename-based cache busting, the plugin supports the following definition in wp-config.php:

define('FRUGAN_UFTYFACF_CACHE_BUSTING_ENABLED', true);

For more information, see filename-based cache busting on Nginx and Apache.

More info

See LINKS file.

Changelog

See auto-CHANGELOG file.

Contributing

For your contributions please use:

Sponsor

Buy Me A Coffee

License

(ɔ) Copyleft 2024 Frugan.
GNU GPLv3, see LICENSE file.

About

Upload Field to YouTube for ACF is a WordPress plugin that allows you to upload videos directly to YouTube via API from the WordPress admin area

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published