PluginProbe
ActivityPub / 7.8.2
ActivityPub v7.8.2
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | templates/admin-header.php +25 -17 1.0.87.8.2 View file →
@@ -1,6 +1,13 @@
1 1 <?php
2 -// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
2 +/**
3 + * Admin header template.
4 + *
5 + * @package Activitypub
6 + */
7 +
8 +/* @var array $args Template arguments. */
9 +$args = wp_parse_args( $args ?? array() );
3 10 ?>
4 11 <div class="activitypub-settings-header">
5 12 <div class="activitypub-settings-title-section">
6 13 <h1><?php \esc_html_e( 'ActivityPub', 'activitypub' ); ?></h1>
@@ -5,23 +12,24 @@
5 12 <div class="activitypub-settings-title-section">
6 13 <h1><?php \esc_html_e( 'ActivityPub', 'activitypub' ); ?></h1>
7 14 </div>
8 15
9 - <nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>">
10 - <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['welcome'] ); ?>">
11 - <?php \esc_html_e( 'Welcome', 'activitypub' ); ?>
12 - </a>
16 + <div class="activitypub-settings-tabs-scroller">
17 + <nav class="activitypub-settings-tabs-wrapper" aria-label="<?php \esc_attr_e( 'Secondary menu', 'activitypub' ); ?>">
18 + <?php
19 + foreach ( $args['tabs'] as $slug => $label ) :
20 + $url = add_query_arg(
21 + array( 'tab' => 'welcome' !== $slug ? $slug : false ),
22 + \admin_url( 'options-general.php?page=activitypub' )
23 + );
24 + ?>
13 25
14 - <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub&tab=settings' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['settings'] ); ?>">
15 - <?php \esc_html_e( 'Settings', 'activitypub' ); ?>
16 - </a>
26 + <a href="<?php echo \esc_url( $url ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args[ $slug ] ); ?>">
27 + <?php echo \esc_html( $label ); ?>
28 + </a>
17 29
18 - <?php if ( ! \Activitypub\is_user_disabled( \Activitypub\Collection\Users::BLOG_USER_ID ) ) : ?>
19 -
20 - <a href="<?php echo \esc_url_raw( admin_url( 'options-general.php?page=activitypub&tab=followers' ) ); ?>" class="activitypub-settings-tab <?php echo \esc_attr( $args['followers'] ); ?>">
21 - <?php \esc_html_e( 'Followers', 'activitypub' ); ?>
22 - </a>
23 -
24 - <?php endif; ?>
25 - </nav>
30 + <?php
31 + endforeach;
32 + ?>
33 + </nav>
34 + </div>
26 35 </div>
27 -<hr class="wp-header-end">