' . esc_html__( 'Custom development', 'submitdock' ) . ''; $links[] = '' . esc_html__( 'Buy me a coffee', 'submitdock' ) . ''; return $links; } /** * Renders the author box with support, custom work, and donation links. */ private static function render_support() { ?>

bealinawaz.com' ); ?>

☕

'array', 'sanitize_callback' => array( 'SubmitDock_Settings', 'sanitize' ), ) ); } /** * Loads the admin styles and the guide's copy buttons on the plugin's own pages. * * @param string $hook Current admin page. */ public static function enqueue( $hook ) { if ( false === strpos( $hook, self::GUIDE_PAGE ) && false === strpos( $hook, self::SETTINGS_PAGE ) ) { return; } $url = plugin_dir_url( SUBMITDOCK_FILE ) . 'assets/'; wp_enqueue_style( 'submitdock-admin', $url . 'admin.css', array(), SUBMITDOCK_VERSION ); wp_enqueue_script( 'submitdock-admin', $url . 'admin.js', array( 'wp-i18n' ), SUBMITDOCK_VERSION, true ); wp_set_script_translations( 'submitdock-admin', 'submitdock' ); } /** * Adds Settings and Guide links on the Plugins screen. * * @param array $links Links. * @return array */ public static function action_links( $links ) { $base = admin_url( 'edit.php?post_type=' . SubmitDock_Submissions::POST_TYPE . '&page=' ); array_unshift( $links, '' . esc_html__( 'Settings', 'submitdock' ) . '', '' . esc_html__( 'Guide', 'submitdock' ) . '' ); return $links; } /** * Settings field name. * * @param string $key Setting key. * @return string */ private static function name( $key ) { return SubmitDock_Settings::OPTION . '[' . $key . ']'; } /** * Renders the settings page. */ public static function render_settings() { if ( ! current_user_can( 'manage_options' ) ) { return; } $s = SubmitDock_Settings::get(); ?>

$label ) : ?>

POST

{', ' event.preventDefault();', ' const data = Object.fromEntries(new FormData(form));', ' data.__context = { page_url: location.href, referrer: document.referrer };', '', ' const response = await fetch("' . $endpoint . '", {', ' method: "POST",', ' headers: { "Content-Type": "application/json" },', ' body: JSON.stringify(data),', ' });', ' const result = await response.json();', ' // result.message is ready to show. Status 200 and 202 both mean the submission was saved.', ' alert(result.message);', ' if (response.ok) form.reset();', '});', ) ) ); ?>

', ' ', ' ', ' ', '', ' ', ' ', ' ', '', ' ', '', ) ) ); ?>

200 {"success": true, "message": "…", "email_status": "sent"}
202
400
403
429