• Resolved Space

    (@bkno)


    By default the plugin reveals the author URL for articles, but some sites have these disabled for privacy or they are not needed. I tried filtering on opengraph_metadata but it doesn’t appear to contain the article:author data.

    I also tried this:

    
    function my_opengraph_metadata( $metadata ) {
        unset( $metadata['article:author'] );
        return $metadata;
    }
    add_filter( 'opengraph_metadata', 'my_opengraph_metadata' );
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matthias Pfefferle

    (@pfefferle)

    Maybe this is a race condition issue, because your filter might be called too early. Maybe add a lower priority, to be sure to be called later as the default filters:

    add_filter( 'opengraph_metadata', 'my_opengraph_metadata', 1, 20 );

    Thread Starter Space

    (@bkno)

    Thank you, that was it. This worked:

    
    function my_opengraph_metadata( $metadata ) {
        unset( $metadata['article:author'] );
        return $metadata;
    }
    add_filter( 'opengraph_metadata', 'my_opengraph_metadata', 20, 1 );
    

    Would be a nice one to add to the docs.

    Plugin Author Matthias Pfefferle

    (@pfefferle)

    Ooops, I twisted the params ??

    ..but I am glad it works!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there a way to filter article:author?’ is closed to new replies.