Turns out the code is correct, the problem is the tutorial site I copy/pasted from was using weird, non standard space characters instead of normal spaces. I replaced the “fake spaces” with “normal spaces” and now everything works.
In order to debug this I needed to look at the Apache error log rather than the WordPress error log. That eventually led me here: https://stackoverflow.com/questions/11493751/unexpected-t-string-in-if-clause-with-spaces
Related Posts:
- Redirect plugin after form submit or show errors
- Custom Form only for admin
- Submit custom form from post content and execute in plugin
- How to allow user to select User ID in Formidable Pro form? [closed]
- Char limit on custom blog-post form? [closed]
- Sync User to cPanel webmail?
- Adding CSS to custom post type admin page causes error
- Display Custom Field Value on Admin Page Column
- How to remove/hide Yoast’s “SEO” tab in admin panel?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Add sub menu page in your plugin
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Is there a way to embed a Google Docs form in a page without using plugins?
- What’s causing this error? “Warning: Invalid argument”
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- easy steps to make front end form without plugin
- Form that generates an ID for the customer
- Move plugin-settings to ‘Settings’-menu in the admin
- Submit Form data to another page via Ajax (WordPress Way)
- Editing a text file from plugin menu
- WordPress Admin Menu defining function is seperate file
- How do I add some javascript validation to the admin interface form’s onsubmit?
- remove all submenus from plugin
- Create WordPress posts from JSON array using plugin in admin
- Plugin getting Cannot modify header information errors
- Ajax Plugin Not Echoing Response
- creating a plug in that would tap into save/update action of posts [closed]
- Plugin that will output submitted form data for user? [closed]
- Simply poll & Events Calendar plugins clashing
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
- How to see which sites use my installed plugins (wordpress multisite)
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- How to use the CSS of the WordPress core in the development of my administration page?
- in source code but I can’t find it in files or plugins
- Updating WordPress plugin admin panel footer text
- WordPress permissions error with admin account
- Creating a form and displaying entry data as a table
- getting notifications about updates only in the “core” page
- How can ι create my own (custom) WordPress table/list?
- Gravity Forms returns to odd position
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- WordPress Multi-Step Product Search
- Remove value from array within post meta ajax admin
- Sell access to form [closed]
- File Uploader – Upload without adding to Media Library
- Add logo to admin menu in my plugin
- Problem after updating plugins
- Custom form not showing in correct place on page
- add_meta_box creating default form field types
- Form Plugin for Api Requests which is used via Shortcode
- How to redirect to a page after the form is submitted
- Call another page in forms
- Echo out element to another page.
- Equivalent of admin.php for public pages
- Remove specific administrator’s capability
- How to Use the Filter “sidebar_login_widget_form_args”
- problem with register_activation_hook in plugin
- Plugin permissions for Editor role
- Select Form Element Not Saving from Plugin Options
- Error: Can´t access facebook comment plugin admin page
- Storing Form data in a different database
- Is it save to replace with in WordPress search form
- Contact Form 7 Plugin emails not being received by some accounts
- Contact Form 7 “non-selectable” options in a drop down [closed]
- How to add an admin alert for missing plugins
- Using AJAX to run SQL statement and populate dropdown
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- How to hide plugin options for editors via functions.php
- Ajax request sends url rather than data
- Gathering all Custom Post Type posts in to array/object the proper way
- Looking for a simple checkout plugin [closed]
- How to add captcha to publish widget
- Adding a jQuery modal dialog to the admin area
- How to create a plugin page that shows XML?
- Plugin for visitors to edit content without logging in? [closed]
- What is the most efficient way of adding additional functionaliy for admin only
- How do I send the contents of a form to deliver to the already existing custom field in the wordpress theme
- Linking form to user meta fields
- WordPress Forms Advance Conditional Logic
- get wpforms ID value from ACF text field
- User loggedin as Subscriber form not sending
- WordPress – send digital product with custom email
- How to create admin setting for this small plugin
- How to create a form where you can select multiple recipients, based on a list of website users?
- login form should redirect to register page for in 1st login next time it should redirected to home page
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- WordPress search input in database, to edit information via form and update the database
- Admin Custom Plugin List Files in admin Table
- Hide all Admin Notices and move on a separate page
- How to get data from a form on a wordpress site?
- WPForms Custom Redirect not working
- Can I create a separate admin section for my plugin?
- Submitting form to PHP
- General Term for this form Field
- How can I implement radio buttons with icons in Contact form 7?
- wp_set_password() does not work!
- Custom Formdata matching with user table
- Hide button after form submit and save state to localstorage
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard