PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.2
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.2
6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 All 155 releases
← All changes | class/class-mainwp-ui.php +42 -3 6.1 → 6.2.2 View file →
@@ -1316,10 +1316,13 @@
1316 1316 */
1317 1317 do_action( 'mainwp_after_header', $websites );
1318 1318 $after_header_content = ob_get_clean();
1319 1319 if ( ! empty( trim( $after_header_content ) ) ) {
1320 + $has_extension_update_failure_notice = false !== strpos( $after_header_content, 'mainwp-extension-update-failure-notice' );
1321 + $admin_notices_style = $has_extension_update_failure_notice ? 'padding-bottom:0 !important;' : '';
1322 + $admin_notices_class = $has_extension_update_failure_notice ? ' mainwp-extension-update-failure-notice-segment' : '';
1320 1323 ?>
1321 - <div class="ui padded segment" id="mainwp-admin-notices-segment">
1324 + <div class="ui padded segment<?php echo esc_attr( $admin_notices_class ); ?>" id="mainwp-admin-notices-segment" style="<?php echo esc_attr( $admin_notices_style ); ?>">
1322 1325 <?php echo $after_header_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1323 1326 </div>
1324 1327 <?php
1325 1328 }
@@ -1531,9 +1534,24 @@
1531 1534 $sidebar_pages = apply_filters( 'mainwp_sidebar_pages', $sidebar_pages );
1532 1535 $current_user = get_current_user_id();
1533 1536 $custom_theme = MainWP_Settings::get_instance()->get_current_user_theme();
1534 1537 $screen = get_current_screen();
1538 + $show_command_palette_trigger = wp_script_is( 'wp-core-commands', 'enqueued' );
1539 + $command_palette_shortcut = '';
1540 + $command_palette_label = '';
1535 1541
1542 + if ( $show_command_palette_trigger ) {
1543 + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Used only to mirror WordPress core shortcut labels.
1544 + $is_apple_os = (bool) preg_match( '/Macintosh|Mac OS X|Mac_PowerPC/i', $_SERVER['HTTP_USER_AGENT'] ?? '' );
1545 +
1546 + $command_palette_shortcut = $is_apple_os
1547 + ? _x( '⌘K', 'keyboard shortcut to open the command palette', 'mainwp' )
1548 + : _x( 'Ctrl+K', 'keyboard shortcut to open the command palette', 'mainwp' );
1549 +
1550 + /* translators: %s: Keyboard shortcut label. */
1551 + $command_palette_label = sprintf( esc_attr__( 'Open command palette (%s)', 'mainwp' ), $command_palette_shortcut );
1552 + }
1553 +
1536 1554 if ( false === $custom_theme ) {
1537 1555 $compat_theme = null;
1538 1556 // to compatible with Custom Dashboard extension settings.
1539 1557 $compat_settings = get_option( 'mainwp_custom_dashboard_settings' );
@@ -1571,8 +1589,17 @@
1571 1589 $website = MainWP_DB::instance()->get_website_by_id( $id );
1572 1590 }
1573 1591 }
1574 1592 ob_start();
1593 + if ( $show_command_palette_trigger ) :
1594 + ?>
1595 + <span id="mainwp-header-command-palette-actions" class="mainwp-768-hide">
1596 + <a href="#" class="ui button hide-if-no-js" id="mainwp-command-palette-trigger" data-tooltip="<?php echo esc_attr( $command_palette_label ); ?>" data-inverted="" data-position="left center" aria-label="<?php echo esc_attr( $command_palette_label ); ?>" onclick='if ( window.wp && wp.data && wp.data.dispatch ) { wp.data.dispatch( "core/commands" ).open(); } return false;'>
1597 + <kbd><?php echo esc_html( $command_palette_shortcut ); ?></kbd>
1598 + </a>
1599 + </span>
1600 + <?php
1601 + endif;
1575 1602 if ( $website ) :
1576 1603 ?>
1577 1604 <?php if ( $id && $website && '' !== $website->sync_errors ) : ?>
1578 1605 <a href="#" class="mainwp-updates-overview-reconnect-site ui green button" adminuser="<?php echo esc_attr( $website->adminname ); ?>" siteid="<?php echo intval( $website->id ); ?>" data-position="bottom right" aria-label="Reconnect <?php echo esc_html( stripslashes( $website->name ) ); ?>" data-tooltip="Reconnect <?php echo esc_html( stripslashes( $website->name ) ); ?>" data-inverted=""><i class="undo alternate icon"></i> <?php echo esc_html__( 'Reconnect', 'mainwp' ); ?></a>
@@ -1777,9 +1804,9 @@
1777 1804 * Method render_page_navigation()
1778 1805 *
1779 1806 * Render page navigation.
1780 1807 *
1781 - * @param array $subitems [access, active, style].
1808 + * @param array $subitems [access, active, style, target, rel].
1782 1809 * @param null $name_caller Menu Name.
1783 1810 */
1784 1811 public static function render_page_navigation( $subitems = array(), $name_caller = null ) { //phpcs:ignore -- NOSONAR - complex.
1785 1812
@@ -1850,10 +1877,22 @@
1850 1877 if ( isset( $item['style'] ) ) {
1851 1878 $style = $item['style'];
1852 1879 }
1853 1880
1881 + $target = '';
1882 + if ( isset( $item['target'] ) ) {
1883 + $target = $item['target'];
1884 + }
1885 +
1886 + $rel = '';
1887 + if ( isset( $item['rel'] ) ) {
1888 + $rel = $item['rel'];
1889 + } elseif ( '_blank' === $target ) {
1890 + $rel = 'noopener noreferrer';
1891 + }
1892 +
1854 1893 ?>
1855 - <a class="<?php echo esc_attr( $class ); ?> item" style="<?php echo esc_attr( $style ); ?>" href="<?php echo esc_url( $item['href'] ); ?>">
1894 + <a class="<?php echo esc_attr( $class ); ?> item" style="<?php echo esc_attr( $style ); ?>" href="<?php echo esc_url( $item['href'] ); ?>" <?php if ( ! empty( $target ) ) : ?>target="<?php echo esc_attr( $target ); ?>"<?php endif; ?> <?php if ( ! empty( $rel ) ) : ?>rel="<?php echo esc_attr( $rel ); ?>"<?php endif; ?>>
1856 1895 <?php echo isset( $item['before_title'] ) ? $item['before_title'] : ''; ?> <?php echo esc_html( $item['title'] ); ?> <?php echo isset( $item['after_title'] ) ? $item['after_title'] : ''; // phpcs:ignore WordPress.Security.EscapeOutput ?>
1857 1896 </a>
1858 1897 <?php
1859 1898 }