public static function shortcodeParamsToOEmbedParams($tweet_id, $shortcode_options = array())
{
$query_parameters = static::getBaseOEmbedParams($tweet_id);
if (empty($query_parameters)) {
return array();
}
// test for valid align value
if (isset($shortcode_options['align']) && $shortcode_options['align'] && array_key_exists($shortcode_options['align'], static::$ALIGN_OPTIONS)) {
$query_parameters['align'] = $shortcode_options['align'];
}
// oembed parameters are the opposite of widget parameters
// hide_* in oEmbed API
foreach (array('cards' => 'hide_media', 'conversation' => 'hide_thread') as $bool_option => $oembed_parameter) {
if (isset($shortcode_options[$bool_option]) && false === $shortcode_options[$bool_option]) {
$query_parameters[$oembed_parameter] = true;
}
}
return $query_parameters;
}