parent_id = add_submenu_page( $parent_slug, esc_html__( 'WebberZone Snippetz Tools', 'add-to-all' ), $menu_title, 'manage_options', 'ata_tools', array( $this, 'render_page' ) ); } /** * Render the tools page. * * @since 2.3.0 * * @return void */ public function render_page() { /* Message for successful file import */ if ( isset( $_GET['settings_import'] ) && 'success' === $_GET['settings_import'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended add_settings_error( 'ata-notices', '', esc_html__( 'Settings have been imported successfully', 'add-to-all' ), 'updated' ); } if ( isset( $_GET['assets_regenerated'] ) && isset( $_GET['snippet_files'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $snippet_count = absint( wp_unslash( $_GET['snippet_files'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended $notice = sprintf( /* translators: %d: number of snippet files regenerated. */ _n( 'Regenerated assets and %d snippet file.', 'Regenerated assets and %d snippet files.', $snippet_count, 'add-to-all' ), $snippet_count ); add_settings_error( 'ata-notices', '', esc_html( $notice ), 'updated' ); } ob_start(); ?>