mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
14 lines
391 B
Text
14 lines
391 B
Text
add_filter( 'aioseo_schema_output', 'aioseo_filter_schema_output' );
|
|
function aioseo_filter_schema_output( $graphs ) {
|
|
if ( is_singular( 'post' ) ) {
|
|
foreach ( $graphs as $index => $graph ) {
|
|
if ( 'Article' === $graph['@type'] ) {
|
|
unset( $graphs[ $index ]['author'] );
|
|
}
|
|
if ( 'Person' === $graph['@type'] ) {
|
|
unset( $graphs[ $index ] );
|
|
}
|
|
}
|
|
}
|
|
return $graphs;
|
|
}
|