WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Filters (1 post)

  1. olivM
    Member
    Posted 2 years ago #

    Hi,

    IMHO this wonderful plugin would be perfect with some filters.

    we were disappointed when we found out that the WPSEO_OpenGraph class do a direct 'echo' and has no filter on any of the outputted content.

    so to be able to customize the og metas, the simplest hack we found was adding a filter on the wpseo_get_value function :

    function wpseo_get_value( $val, $postid = '' ) {
    	if ( empty($postid) ) {
    		global $post;
    		if (isset($post))
    			$postid = $post->ID;
    		else
    			return false;
    	}
    	$custom = get_post_custom($postid);
    	if (!empty($custom['_yoast_wpseo_'.$val][0]))
    		return apply_filter('wpseo_get_value', maybe_unserialize( $custom['_yoast_wpseo_'.$val][0]), $val, $post_id );
    	else
    		return false;
    }

    perhaps you can add it to a future release

    and thanks again for your work.

    http://wordpress.org/extend/plugins/wordpress-seo/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic