8, 'sources' => implode(',', array_keys(HGSF_SOURCES))], (array) $attributes, 'hg_socialfeed'); $limit = max(1, min(HGSF_POSTS_MAX, (int) $attributes['limit'])); $posts = []; $profiles = []; foreach (hgsf_shortcode_sources($attributes) as $source => $provider) { $connection = hgsf_connection($source); $profile_url = hgsf_profile_url($source, $connection); if ($profile_url) { $profiles[$source] = $profile_url; } foreach (hgsf_cached_posts($connection, $source) as $post) { $posts[] = ['source' => $source] + $post; } } if (!$profiles) { return ''; } $posts = array_slice(hgsf_sort_posts($posts), 0, HGSF_POSTS_MAX); hgsf_feed_styles(); if (count($posts) > $limit) { wp_enqueue_script('hg-socialfeed', plugins_url('assets/feed.js', HGSF_PLUGIN_FILE), [], HGSF_VERSION, ['in_footer' => true]); } if (in_array('x', array_column($posts, 'source'), true)) { wp_enqueue_script('hg-socialfeed-x', 'https://platform.twitter.com/widgets.js', [], null, ['in_footer' => true, 'strategy' => 'async']); } $grid_id = wp_unique_id('hgsf-grid-'); ob_start(); ?>
$limit) : ?> $url) : ?> Volg ons op
Bekijk bericht op X
'Bekijk de video', 'CAROUSEL_ALBUM' => 'Bekijk de foto’s', default => 'Bekijk het bericht', }; $label .= ' op ' . $platform; $has_image = $post['image'] !== ''; ?> aria-label=""> implode(',', array_keys(HGSF_SOURCES))], (array) $attributes, 'hg_sociallinks'); $links = []; foreach (hgsf_shortcode_sources($attributes) as $source => $provider) { $url = hgsf_profile_url($source, hgsf_connection($source)); if ($url) { $links[$source] = $url; } } if (!$links) { return ''; } hgsf_feed_styles(); ob_start(); ?>