Commit fb395f72 authored by Isaque Melo's avatar Isaque Melo

Fix conflit

parents 94ad56c6 c02299ec
......@@ -12,7 +12,7 @@ namespace widgets;
class FeaturedVideos extends \SiteOrigin_Widget {
function __construct() {
wp_enqueue_script('featured-videos', plugins_url('/pagebuilder-components/pagebuilder-components/widgets/featured-videos/featured-videos.js'), ['jquery']);
wp_enqueue_script('featured-videos', plugins_url('/featured-videos.js', __FILE__), ['jquery']);
$fields = [
'header' => [
......
......@@ -3,6 +3,10 @@
$api_key = $instance['youtube_api_key'];
$list_id = $instance['youtube_list_id'];
if(!$api_key || !$list_id){
return;
}
$num = 4;
if($instance['youtube_list'] == 'playlist'){
$url = "https://www.googleapis.com/youtube/v3/playlistItems?key={$api_key}&playlistId={$list_id}&maxResults={$num}&part=snippet,id&order=date";
......@@ -57,7 +61,9 @@ $extract_vid = function($video){
</div>
<div class="column medium-7 small-12 mt-sm-20 p-0">
<div class="row">
<iframe class="column small-12 medium-12 js-featured-videos--iframe p-0" src="https://www.youtube.com/embed/<?= $extract_vid($result->items[0]) ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<div class="featured-videos--iframe-wrapper">
<iframe class="column small-12 medium-12 js-featured-videos--iframe featured-videos--iframe" src="https://www.youtube.com/embed/<?= $extract_vid($result->items[0]) ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
</div>
<div class="row">
<?php foreach($result->items as $index => $video): ?>
......
......@@ -25,7 +25,7 @@ use guaraci\images;
$post_categories = wp_get_post_categories( get_the_ID() );
foreach($post_categories as $category_id){
$category = get_category($category_id);
$category = get_term($category_id);
?>
<div class="categories-list--category category-<?= $category->slug ?>">
<a href="<?= esc_url(get_term_link($category, 'category')) ?>"><?= $category->name ?></a>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment