*/ public static function build( Node_Context $c ): array { $settings = $c->settings; $name = trim( (string) $settings->value( 'profile', 'entity_name' ) ); $same_as = array(); foreach ( self::SOCIAL as $network ) { $url = (string) $settings->value( 'profile', $network ); if ( '' !== $url ) { $same_as[] = $url; } } $node = array( '@type' => $c->is_person() ? 'Person' : 'Organization', '@id' => $c->entity_id(), 'name' => '' !== $name ? $name : wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), 'url' => home_url( '/' ), 'sameAs' => $same_as, ); if ( null !== self::logo( $c ) ) { $node[ $c->is_person() ? 'image' : 'logo' ] = array( '@id' => Ids::logo() ); } return $node; } /** * The logo as an ImageObject node. * * @since 1.0.0 * * @param Node_Context $c Page information. * @return array|null */ public static function logo( Node_Context $c ): ?array { return Image_Node::build( (int) $c->settings->value( 'profile', 'entity_logo_id' ), Ids::logo() ); } }