a.site-title', 'body .elementor-widget-theme-site-title', 'body .elementor-widget-site-title' ) ); } if ( self::hides_description() ) { $selectors = array_merge( $selectors, array( 'body .site-description', 'body #site-description', 'body .wp-block-site-tagline', 'body header .site-branding > p.site-description' ) ); } /** * Filter the selectors hidden by the publication-identity switches. * * @param string[] $selectors CSS selectors. */ $selectors = (array) apply_filters( 'publishrank_hidden_identity_selectors', array_values( array_unique( $selectors ) ) ); return array_values( array_filter( array_map( 'trim', array_map( 'strval', $selectors ) ) ) ); } /** Visually-hidden CSS for the selectors (kept readable by screen readers and crawlers). */ public static function css() { $selectors = self::selectors(); if ( empty( $selectors ) ) { return ''; } return implode( ',', $selectors ) . '{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;}'; } public function styles() { if ( is_admin() || wp_doing_ajax() || is_feed() || is_robots() || ( function_exists( 'is_embed' ) && is_embed() ) ) { return; } $css = self::css(); if ( '' === $css ) { return; } echo '' . "\n"; } /** Titles, meta and schema use the PublishRank values only, so say so when they are empty (PublishRank screens only). */ public function missing_identity_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; if ( ! $screen || false === strpos( (string) $screen->id, 'publishrank' ) ) { return; } $missing = array(); if ( '' === PublicationProfile::publication_name() ) { $missing[] = __( 'publication title', 'publishrank' ); } if ( '' === PublicationProfile::publication_description() ) { $missing[] = __( 'publication description', 'publishrank' ); } if ( empty( $missing ) ) { return; } echo '
' . esc_html( sprintf( /* translators: %s: list of missing settings. */ __( 'PublishRank uses its own publication identity, not the WordPress Site Title or Tagline. Set the %s in the setup wizard or Identity settings so titles, meta tags and structured data are complete.', 'publishrank' ), implode( ' / ', $missing ) ) ) . '