wp_pointers[] = 'tp20_options_custom_css_css_variables'; } 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( 'frontend-options', __( 'Frontend Options and 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' ); } } /** * Print 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 ) { ?>
| : | |
|---|---|
|
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' ); ?> |
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' );
?>
' . __( 'Did you know?', 'tablepress' ) . ' ' . __( 'To change the table colors, you can easily set new ones with CSS variables.', 'tablepress' ) . ' ' . sprintf( __( 'Read more in the TablePress FAQ.', 'tablepress' ), 'https://tablepress.org/faq/' ) . '
'; $this->admin_page->print_wp_pointer_js( 'tp20_options_custom_css_css_variables', '#option-custom-css + .CodeMirror', array( 'content' => $content, 'position' => array( 'edge' => 'top', 'align' => 'center' ), ) ); } } // class TablePress_Options_View