/** * Returns a link back to a theme author URI. * * @return string * @since 1.3 */ function momtaz_get_theme_author_link($theme, array $args = array()) { if (is_string($theme)) { $theme = wp_get_theme($theme); } if (empty($theme) || !$theme->exists()) { return; } $args = array_merge(array('text' => $theme->display('Author', FALSE), 'atts' => array('href' => $theme->get('AuthorURI'), 'class' => 'theme-author-link')), $args); $link = '<a' . momtaz_get_html_atts($args['atts']) . '>' . $args['text'] . '</a>'; $link = apply_filters('momtaz_get_theme_author_link', $link, $theme, $args); return $link; }
/** * Returns a "Continue Reading" link for excerpts. * * @return string * @since 1.3 */ function momtaz_get_continue_reading_link($post = 0, array $args = array()) { if (empty($post)) { $post = get_post(); } $args = array_merge(array('text' => __('Continue reading <span class="meta-nav">→</span>', 'momtaz'), 'atts' => array('href' => get_permalink($post), 'class' => 'more-link')), $args); $link = '<a' . momtaz_get_html_atts($args['atts']) . '>' . $args['text'] . '</a>'; return apply_filters('momtaz_continue_reading_link', $link, $post, $args); }
/** * Output HTML attributes list. * * @param array $atts An associative array of attributes and their values. * @param array $args An array of arguments to be applied on the function output. * @uses momtaz_get_html_atts() Convert an associative array to HTML attributes list. * @since 1.0 */ function momtaz_html_atts(array $atts, array $args = null) { echo momtaz_get_html_atts($atts, $args); }
/** * Retrieve stylesheet link tag with the proper attributes. * * @return string * @since 1.0 */ function momtaz_get_style_loader_tag($stylesheet_url, array $atts = array()) { if (empty($stylesheet_url)) { return; } $atts = array_merge(array('href' => $stylesheet_url, 'media' => 'all'), $atts); if (empty($atts['rel'])) { switch (pathinfo($atts['href'], PATHINFO_EXTENSION)) { case 'less': $atts['rel'] = 'stylesheet/less'; break; default: $atts['rel'] = 'stylesheet'; break; } } $output = '<link' . momtaz_get_html_atts($atts) . ' />' . "\n"; $output = apply_filters('momtaz_get_style_loader_tag', $output, $atts); return $output; }