` heading. Defaults to "Settings". */ public function __construct( private SettingsRegistry $registry, private string $page_slug = '', private string $registry_page = 'default', private string $heading = '' ) { if ( '' === $this->page_slug ) { $this->page_slug = Menu::SLUG . '-settings'; } if ( '' === $this->heading ) { $this->heading = __( 'Settings', 'all-in-one-utilities' ); } } /** * Hook registration with the core Settings API. * * @return void */ public function boot(): void { add_action( 'admin_init', array( $this, 'register' ) ); } /** * Register every tab as a WordPress option/setting. * * @return void */ public function register(): void { $this->registry->register_with_wp(); } /** * Render the Settings screen. * * @return void */ public function render(): void { $tabs = $this->registry->get_tabs_for_page( $this->registry_page ); if ( empty( $tabs ) ) { ?>
| id ] ?? $field->default, $name_prefix . '[' . $section_id . ']', $field_html_id ); ?> | args['label_above'] ) ) : ?>
doc ) : ?>
render_info_button( 'field-' . $section_id . '-' . $field->id, $field->label ); ?>
id ] ?? $field->default, $name_prefix . '[' . $section_id . ']', $field_html_id ); ?>
|
doc ) : ?> render_info_button( 'field-' . $section_id . '-' . $field->id, $field->label ); ?> | id ] ?? $field->default, $name_prefix . '[' . $section_id . ']', $field_html_id ); ?> | ||
|---|---|---|---|---|---|
%2$s', esc_url( add_query_arg( array( 'page' => $this->page_slug_for( $tabs[ $source ]['page'] ?? 'default' ), 'tab' => $source, ), admin_url( 'admin.php' ) ) ), esc_html( $tabs[ $source ]['label'] ?? $source ) ); } printf( /* translators: %s: link(s) to the settings tab(s) these fields also appear on */ esc_html__( 'These are the same settings shown on the %s tab. Changes saved here or there update both.', 'all-in-one-utilities' ), implode( ', ', $links ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- each link is built from esc_url()/esc_html() above. ); ?>