protected static function addPostMetaOptions($options)
{
if (!is_array($options)) {
$options = array();
}
$post_meta = static::getPostMeta();
if (empty($post_meta)) {
return $options;
}
// allow shortcode text to override post text
// example: multiple Tweet buttons in a post
if (!(isset($options['text']) && trim($options['text']))) {
if (isset($post_meta['text'])) {
$text = trim($post_meta['text']);
if ($text) {
$options['text'] = $text;
}
unset($text);
}
}
// allow shortcode hashtags to override post hashtags
// example: multiple Tweet buttons in a post
if (!isset($options['hashtags']) || empty($options['hashtags'])) {
if (isset($post_meta['hashtags']) && is_array($post_meta['hashtags']) && !empty($post_meta['hashtags'])) {
$options['hashtags'] = $post_meta['hashtags'];
}
}
return $options;
}