%s', esc_url( get_permalink() ), trim( $text ) );
return $text;
}
/**
* Wraps the output of `wp_link_pages()` with `
` if it's simply wrapped in a
* `
` tag.
*
* @since 1.0.0
* @access public
* @param array $args
* @return array
*/
function hoot_link_pages_args( $args ) {
$args['before'] = str_replace( '
', '
', $args['before'] );
return $args;
}
/**
* Wraps page "links" that aren't actually links (just text) with `` so that they
* can also be styled. This makes `wp_link_pages()` consistent with the output of `paginate_links()`.
*
* @since 1.0.0
* @access public
* @param string $link
* @return string
*/
function hoot_link_pages_link( $link ) {
if ( 0 !== strpos( $link, '{$link}";
return $link;
}
/**
* Adds microdata to the author posts link.
*
* @since 1.0.0
* @access public
* @param string $link
* @return string
*/
function hoot_the_author_posts_link( $link ) {
$pattern = array(
"/()/i",
'/()(.*?)(<\/a>)/i'
);
$replace = array(
'$1 class="url fn n" itemprop="url"$2',
'$1$2$3'
);
return preg_replace( $pattern, $replace, $link );
}
/**
* Adds microdata to the comment author link.
*
* @since 1.0.0
* @access public
* @param string $link
* @return string
*/
function hoot_get_comment_author_link( $link ) {
$patterns = array(
'/(class=[\'"])(.+?)([\'"])/i',
"/()/i",
'/()(.*?)(<\/a>)/i'
);
$replaces = array(
'$1$2 fn n$3',
'$1 itemprop="url"$2',
'$1$2$3'
);
return preg_replace( $patterns, $replaces, $link );
}
/**
* Adds microdata to the comment author URL link.
*
* @since 1.0.0
* @access public
* @param string $link
* @return string
*/
function hoot_get_comment_author_url_link( $link ) {
$patterns = array(
'/(class=[\'"])(.+?)([\'"])/i',
"/()/i"
);
$replaces = array(
'$1$2 fn n$3',
'$1 itemprop="url"$2'
);
return preg_replace( $patterns, $replaces, $link );
}
/**
* Adds microdata to the comment reply link.
*
* @since 1.0.0
* @access public
* @param string $link
* @return string
*/
function hoot_comment_reply_link_filter( $link ) {
return preg_replace( '/()/i', '$1itemprop="image" $2', $avatar );
}
/**
* Adds microdata to the post thumbnail HTML.
*
* @since 1.0.0
* @access public
* @param string $html
* @return string
*/
function hoot_post_thumbnail_html( $html ) {
return preg_replace( '/()/i', '$1itemprop="image" $2', $html );
}
/**
* Adds microdata to the comments popup link.
*
* @since 1.0.0
* @access public
* @param string $attr
* @return string
*/
function hoot_comments_popup_link_attributes( $attr ) {
return 'itemprop="discussionURL"';
}