$data Data for this view. */ #[\Override] public function setup( /* string */ $action, array $data ) /* : void */ { // Don't use type hints in the method declaration to prevent PHP errors, as the method is inherited. parent::setup( $action, $data ); $this->admin_page->enqueue_script( 'options' ); $this->process_action_messages( array( 'success_save' => __( 'Options saved successfully.', 'tablepress' ), 'success_save_error_custom_css' => __( 'Options saved successfully, but “Custom CSS” was not saved to file.', 'tablepress' ), 'error_save' => __( 'Error: Options could not be saved.', 'tablepress' ), ) ); $this->add_text_box( 'head', array( $this, 'textbox_head' ), 'normal' ); if ( current_user_can( 'tablepress_edit_options' ) ) { // Enqueue WordPress copy of CodeMirror, with CSS linting, etc., for the "Custom CSS" textarea, which is only shown to admins. $codemirror_settings = wp_enqueue_code_editor( array( 'type' => 'text/css' ) ); if ( ! empty( $codemirror_settings ) ) { // Load CSS adjustments for CodeMirror and the added vertical resizing. $this->admin_page->enqueue_style( 'codemirror', array( 'code-editor' ) ); $this->admin_page->enqueue_script( 'codemirror' ); } $this->add_meta_box( 'default-style', sprintf( __( 'Default Styling %s', 'tablepress' ), '' . ( tb_tp_fs()->is_free_plan() ? __( 'Premium', 'tablepress' ) : __( 'beta', 'tablepress' ) ) . '' ), array( $this, 'postbox_default_style_customizer_screen' ), 'normal' ); $this->add_meta_box( 'frontend-options', __( 'Custom Styling', 'tablepress' ), array( $this, 'postbox_frontend_options' ), 'normal' ); } $this->add_meta_box( 'user-options', __( 'User Options', 'tablepress' ), array( $this, 'postbox_user_options' ), 'normal' ); $this->add_text_box( 'submit', array( $this, 'textbox_submit_button' ), 'submit' ); if ( current_user_can( 'deactivate_plugin', TABLEPRESS_BASENAME ) && current_user_can( 'tablepress_edit_options' ) && current_user_can( 'tablepress_delete_tables' ) && ! is_plugin_active_for_network( TABLEPRESS_BASENAME ) ) { $this->add_text_box( 'uninstall-tablepress', array( $this, 'textbox_uninstall_tablepress' ), 'submit' ); } } /** * Prints the screen head text. * * @since 1.0.0 * * @param array $data Data for this screen. * @param array $box Information about the text box. */ public function textbox_head( array $data, array $box ): void { ?>

$data Data for this screen. * @param array $box Information about the meta box. */ public function postbox_default_style_customizer_screen( array $data, array $box ): void { if ( tb_tp_fs()->is_free_plan() ) : ?>

<?php esc_attr_e( 'Screenshot of the Default Style Customizer that is part of the TablePress premium versions.', 'tablepress' ); ?>
$data Data for this screen. * @param array $box Information about the meta box. */ public function postbox_frontend_options( array $data, array $box ): void { ?>
:

Cascading Style Sheets) can be used to change the styling or layout of a table.', 'tablepress' ), 'https://www.htmldog.com/guides/css/beginner/' ); echo ' '; printf( __( 'You can get styling examples from the FAQ.', 'tablepress' ), 'https://tablepress.org/faq/' ); echo ' '; printf( __( 'Information on available CSS selectors can be found in the Documentation.', 'tablepress' ), 'https://tablepress.org/documentation/' ); echo ' '; _e( 'Please note that invalid CSS code will be stripped, if it can not be corrected automatically.', 'tablepress' ); ?>

$data Data for this screen. * @param array $box Information about the meta box. */ public function postbox_user_options( array $data, array $box ): void { // Get list of current admin menu entries. $entries = array(); foreach ( $GLOBALS['menu'] as $entry ) { if ( str_contains( $entry[2], '.php' ) ) { $entries[ $entry[2] ] = $entry[0]; } } // Remove elements with notification bubbles (e.g. update or comment count). if ( isset( $entries['plugins.php'] ) ) { $entries['plugins.php'] = preg_replace( '/ /', '', $entries['plugins.php'] ); } if ( isset( $entries['edit-comments.php'] ) ) { $entries['edit-comments.php'] = preg_replace( '/ /', '', $entries['edit-comments.php'] ); } // Add separator and generic positions. $entries['-'] = '---'; $entries['top'] = __( 'Top-Level (top)', 'tablepress' ); $entries['middle'] = __( 'Top-Level (middle)', 'tablepress' ); $entries['bottom'] = __( 'Top-Level (bottom)', 'tablepress' ); $select_box = '\n"; ?>
$data Data for this screen. * @param array $box Information about the text box. */ #[\Override] public function textbox_submit_button( array $data, array $box ): void { ?>

$data Data for this screen. * @param array $box Information about the text box. */ public function textbox_uninstall_tablepress( array $data, array $box ): void { ?>

will permanently delete all TablePress tables and options from the database.', 'tablepress' ) . '
' . __( 'It is recommended that you create a backup of the tables (by exporting the tables in the JSON format), in case you later change your mind.', 'tablepress' ) . '
' . __( 'You will manually need to remove the plugin’s files from the plugin folder afterwards.', 'tablepress' ) . '
' . __( 'Be very careful with this and only click the button if you know what you are doing!', 'tablepress' ); ?>