Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/airesvsg/acf-youtubepicker
Search and select videos on YouTube without leaving the page.
https://github.com/airesvsg/acf-youtubepicker
Last synced: about 1 month ago
JSON representation
Search and select videos on YouTube without leaving the page.
- Host: GitHub
- URL: https://github.com/airesvsg/acf-youtubepicker
- Owner: airesvsg
- Created: 2015-04-21T22:15:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-11T00:18:21.000Z (about 5 years ago)
- Last Synced: 2024-08-03T17:10:48.226Z (4 months ago)
- Language: PHP
- Homepage: https://wordpress.org/plugins/acf-youtube-picker
- Size: 66.4 KB
- Stars: 50
- Watchers: 8
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-acf - YouTube Picker - Search and select videos on YouTube without leaving the page. (Third-Party Add-Ons)
README
ACF YouTube Picker Field
================
Search and select videos on YouTube without leaving the page.![ACF YouTube Picker Field](http://www.airesgoncalves.com.br/youtubepicker/acf-youtubepicker-v3.png)
- [Compatibility](#compatibility)
- [Installation](#installation)
- [Retrieving data](#retrieving-data)
- [Retrieving data - Single](#single)
- [Retrieving data - Multiple](#multiple)Compatibility
================
This ACF field type is compatible with:
* ACF 5
* ACF 4Installation
================
1. Copy the `acf-youtubepicker` folder into your `wp-content/plugins` folder
2. Activate the `YouTube Picker` plugin via the plugins admin page
3. Create a new field via ACF and select the `YouTube Picker` typeRetrieving data
================#### Single
```php
// how to display data
$video = get_field( 'youtube_single_video' );if( $video ) {
echo '' . $video['title'] . '
';
echo '';
}
``````php
$video = get_field('youtube_single_video');print_r( $video );
// Output
Array
(
[title] => Rio 2016
[vid] => Z00jjc-WtZI
[url] => https://www.youtube.com/watch?v=Z00jjc-WtZI
[duration] => 00:02:23
[thumbs] => Array
(
[default] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/default.jpg
[width] => 120
[height] => 90
)[medium] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/mqdefault.jpg
[width] => 320
[height] => 180
)[high] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/hqdefault.jpg
[width] => 480
[height] => 360
)[standard] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/sddefault.jpg
[width] => 640
[height] => 480
)[maximum] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/maxresdefault.jpg
[width] => 640
[height] => 480
))
[iframe] =>
)
```#### Multiple
```php
// how to display data
$videos = get_field( 'youtube_multiple_videos' );if( $videos ) {
foreach( $videos as $v ) {
echo '' . $v['title'] . '
';
echo '';
}
}
``````php
$videos = get_field('youtube_multiple_videos');print_r( $videos );
// Output
Array
(
[0] => Array
(
[title] => Rio 2016
[vid] => Z00jjc-WtZI
[url] => https://www.youtube.com/watch?v=Z00jjc-WtZI
[duration] => 00:02:23
[thumbs] => Array
(
[default] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/default.jpg
[width] => 120
[height] => 90
)[medium] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/mqdefault.jpg
[width] => 320
[height] => 180
)[high] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/hqdefault.jpg
[width] => 480
[height] => 360
)[standard] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/sddefault.jpg
[width] => 640
[height] => 480
)[maximum] => Array
(
[url] => https://i1.ytimg.com/vi/Z00jjc-WtZI/maxresdefault.jpg
[width] => 640
[height] => 480
))
[iframe] =>
)
)
```