Kokapet

Back to top button
/** * News Desk author archive: Organization, not Person. * SASWP: saswp_modify_author_output * Only user_id 68 (News Desk). */ add_filter( 'saswp_modify_author_output', 'siasat_newsdesk_author_schema' ); function siasat_newsdesk_author_schema( $input ) { if ( ! is_author() ) { return $input; } $user = get_queried_object(); if ( ! $user || (int) $user->ID !== 68 ) { return $input; } $desk = array( '@context' => 'https://schema.org', '@type' => 'Organization', '@id' => 'https://www.siasat.com/author/newsdesk/#desk', 'name' => 'News Desk', 'alternateName' => 'Siasat News Desk', 'url' => 'https://www.siasat.com/author/newsdesk/', 'description' => 'The Siasat Daily news desk. Desk and agency copy, including wire. Staff reporting is bylined to the individual journalist.', 'parentOrganization' => array( '@type' => 'NewsMediaOrganization', 'name' => 'The Siasat Daily', 'url' => 'https://www.siasat.com/', ), 'sameAs' => array( 'https://twitter.com/TheSiasatDaily', ), ); if ( ! is_array( $input ) ) { return $desk; } // SASWP sometimes passes a list of graphs. if ( isset( $input[0] ) && is_array( $input[0] ) ) { foreach ( $input as $i => $block ) { if ( ! is_array( $block ) ) { continue; } $type = isset( $block['@type'] ) ? $block['@type'] : ''; $name = isset( $block['name'] ) ? $block['name'] : ''; if ( $type === 'Person' && $name === 'News Desk' ) { $input[ $i ] = $desk; } } return $input; } return $desk; }