'array', 'sanitize_callback' => array( Settings::class, 'sanitize' ), 'default' => Settings::defaults(), ) ); } /** * Flush links when slugs or the events page change. * * @param mixed $old Old value. * @param mixed $new New value. */ public static function after_save( $old, $new ) { Settings::flush(); $keys = array( 'event_slug', 'venue_slug', 'organizer_slug', 'events_page_id', 'tec_urls', 'category_base' ); foreach ( $keys as $k ) { if ( ( isset( $old[ $k ] ) ? $old[ $k ] : null ) !== ( isset( $new[ $k ] ) ? $new[ $k ] : null ) ) { update_option( 'evwr_flush_rewrites', 1 ); break; } } } /** * Checkbox row. * * @param string $key Key. * @param string $label Label. */ private static function checkbox( $key, $label ) { echo ''; } /** * Text row. * * @param string $key Key. * @param string $type Type. * @param string $extra Extra attributes (fixed strings only). */ private static function text( $key, $type = 'text', $extra = '' ) { echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Fixed attribute strings. } /** * Render. */ public static function render() { if ( ! current_user_can( 'manage_options' ) ) { return; } $opt = Settings::OPTION; ?>