public static function display($args = []) { global $post; $opt = self::get_options(); $img_url = theme_features::get_thumbnail_src($post->ID); $defaults = array('post_title_text' => theme_cache::get_the_title($post->ID), 'post_url' => theme_cache::get_permalink($post->ID), 'blog_name' => theme_cache::get_bloginfo('name'), 'blog_url' => theme_cache::home_url(), 'img_url' => esc_url($img_url), 'post_excerpt' => esc_attr(mb_substr(html_minify(strip_tags(get_the_excerpt())), 0, 120)), 'post_content' => esc_attr(mb_substr(html_minify(strip_tags(get_the_content())), 0, 120)), 'author' => theme_cache::get_the_author_meta('display_name', $post->post_author)); $output_keywords = array_merge($defaults, $args); $tpl_keywords = array('%post_title_text%', '%post_url%', '%blog_name%', '%blog_url%', '%img_url%', '%post_excerpt%', '%post_content%', '%author%'); $post_share_code = stripslashes(str_ireplace($tpl_keywords, $output_keywords, $opt['code'])); echo $post_share_code; }