$label ) : ?>
card_open_svg( '
', __( 'Site Identity', 'admin-buddy' ), __( 'Global branding elements that appear across WordPress.', 'admin-buddy' ) ); ?>
card_close(); ?>
card_open_svg( '
', __( 'Admin Bar', 'admin-buddy' ), __( 'Control what appears in the top admin toolbar and replace WordPress branding.', 'admin-buddy' ) ); ?>
[ 'label' => __( 'Remove WordPress Logo', 'admin-buddy' ), 'desc' => __( 'Hides the WP logo from the admin toolbar.', 'admin-buddy' ), 'default' => '1' ],
'admbud_wl_remove_wp_links' => [ 'label' => __( 'Remove WordPress.org Links', 'admin-buddy' ), 'desc' => __( 'Hides "About WordPress", "Documentation", "Support Forums" and "Feedback" from the admin bar dropdown.', 'admin-buddy' ), 'default' => '0' ],
'admbud_show_in_adminbar' => [ 'label' => __( 'Show Admin Buddy in Admin Bar','admin-buddy' ), 'desc' => __( 'Adds a quick-access link to Admin Buddy in the top toolbar.', 'admin-buddy' ), 'default' => '0' ],
'admbud_core_remove_help' => [ 'label' => __( 'Hide Help Tab', 'admin-buddy' ), 'desc' => __( 'Hides the Help dropdown tab from all admin pages.', 'admin-buddy' ), 'default' => '0' ],
'admbud_core_remove_screen_options' => [ 'label' => __( 'Hide Screen Options', 'admin-buddy' ), 'desc' => __( 'Hides the Screen Options dropdown tab from admin pages.', 'admin-buddy' ), 'default' => '0' ],
];
foreach ( $admbud_bar_toggles as $key => $item ) :
$checked = admbud_get_option( $key, $item['default'] ) === '1';
?>
card_close(); ?>
card_open_svg( '
', __( 'Footer', 'admin-buddy' ), __( 'Customise the admin page footer area.', 'admin-buddy' ) ); ?>
card_close(); ?>
` inside `//`
* comments here — PHP's single-line comment is terminated
* by a literal `?` followed by `>` even *inside* the
* comment text, which would close the surrounding PHP
* block and prevent the assignment below from running.
* Use block comments for any prose that mentions PHP
* delimiters.
*/
$admbud_page_dropdown_lis = function( $pages, $selected ) {
foreach ( $pages as $p ) {
$label = $p->post_title ?: __( '(no title)', 'admin-buddy' );
if ( $p->post_status !== 'publish' ) {
$label .= ' [' . ucfirst( $p->post_status ) . ']';
}
$is_selected = ( (string) $p->ID === (string) $selected );
printf(
'
%s',
$is_selected ? ' is-selected' : '',
esc_attr( $p->ID ),
$is_selected ? ' aria-selected="true"' : '',
esc_html( $label )
);
}
};
// Resolve the current default-page label so the trigger
// text reflects what's stored. `0` is "WP dashboard"; any
// other value matches a page ID.
$admbud_default_page_label = __( '- WordPress Dashboard -', 'admin-buddy' );
if ( (int) $default_page > 0 ) {
foreach ( $pages as $p ) {
if ( (int) $p->ID === (int) $default_page ) {
$admbud_default_page_label = $p->post_title ?: __( '(no title)', 'admin-buddy' );
break;
}
}
}
?>
card_open_svg( '
', __( 'Dashboard Page', 'admin-buddy' ), __( 'Show a custom page instead of the standard WordPress dashboard.', 'admin-buddy' ) ); ?>
roles;
foreach ( $wp_roles as $role_slug => $role_data ) :
$role_page = $role_pages[ $role_slug ] ?? '';
?>
0 ) {
foreach ( $pages as $p ) {
if ( (int) $p->ID === (int) $role_page ) {
$admbud_role_trigger_label = $p->post_title ?: __( '(no title)', 'admin-buddy' );
break;
}
}
}
?>
card_close(); ?>
$v ) {
if ( $k === '_per_role' || $k === '_default' ) { continue; }
if ( is_int( $v ) && $v > 0 ) { $any_page_set = true; break; }
}
}
if ( ! $any_page_set ) :
// -- Card: Dashboard Widgets -------------------------------- ?>
card_open_svg(
'
',
__( 'Dashboard Widgets', 'admin-buddy' ),
__( 'Choose which dashboard widgets to show. Toggle off to hide.', 'admin-buddy' )
);
?>
' . esc_html__( 'WordPress Dashboard', 'admin-buddy' ) . ''
);
?>
$wtitle ) :
// If never configured, all are checked (visible). If configured, only kept ones are checked.
$checked = $is_configured ? in_array( $wid, $keep_ids, true ) : true;
?>
card_close(); ?>
card_open_svg(
'
',
__( 'Custom Widgets', 'admin-buddy' ),
__( 'Add your own dashboard widgets. Supports HTML and shortcodes.', 'admin-buddy' )
);
?>
card_close(); ?>