Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Filters

  • 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;
    			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 );
    		return false;

    perhaps you can add it to a future release

    and thanks again for your work.

  • The topic ‘[Plugin: WordPress SEO by Yoast] Filters’ is closed to new replies.