/**
 * This function filters the post link when viewing a post with the `link` post format.
 *
 * @since  4.0.0
 * @param  array  $args The defaults arguments used to display a post title.
 * @param  int    $post_id
 * @param  string $post_type
 * @return array
 */
function cherry_get_the_link_url($args, $post_id, $post_type)
{
    if (!post_type_supports($post_type, 'post-formats')) {
        return $args;
    }
    if (!has_post_format('link')) {
        return $args;
    }
    $args['url'] = apply_filters('cherry_link_title_url', cherry_get_post_format_url());
    return $args;
}
Example #2
0
/**
 * This function filters the post link when viewing a post with the `link` post format.
 *
 * @since  4.0.0
 * @param  array  $args      The defaults arguments used to display a post title.
 * @param  int    $post_id   The post ID.
 * @param  string $post_type The post type.
 * @return array
 */
function cherry_get_the_link_url($args, $post_id, $post_type)
{
    if (!post_type_supports($post_type, 'post-formats')) {
        return $args;
    }
    if (!has_post_format('link')) {
        return $args;
    }
    /**
     * Filter a URL for post-format `link` title.
     *
     * @since 4.0.0
     * @param string $url URL for post-format `link` title.
     */
    $args['url'] = apply_filters('cherry_link_title_url', cherry_get_post_format_url());
    return $args;
}