* SPDX-FileCopyrightText: 2021 Harald Eilertsen * * SPDX-License-Identifier: AGPL-3.0-or-later */ if ( ! class_exists( 'GiglogAdmin_VenueForm' ) ) { class GiglogAdmin_VenueForm { public function render() : string { return '
' . '

VENUE DETAILS

' . '
' . '
' . wp_nonce_field( 'edit-venue', 'nonce' ) . '
' . ' ' . ' ' . '
' . '
' . ' ' . ' ' . '
' . '
' . ' ' . '
' . '
' . '' . '
'; } static function update() : void { if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'edit-venue' ) ) { header( "{$_SERVER['SERVER_PROTOCOL']} 403 Forbidden" ); wp_die( 'CSRF validation failed.', 403 ); } if ( empty( $_POST['venuename'] ) || empty( $_POST['venuecity'] ) ) { echo ''; } else { GiglogAdmin_Venue::create( $_POST['venuename'], $_POST['venuecity'] ); echo ''; } } } }