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
- Best collection of code for your 'functions.php' file [closed]
- Contact form 7 select box different value-text than content-text in option [closed]
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Admin plugin, how can I output a different content-type?
- How can I log a user out of WordPress before the page loads?
- How do I only load a plugin js on it’s settings pages?
- How to enable Admins to see Plugins
- Bad Request (Invalid Hostname) on working server, database problem
- How to develop a community feature in the dashboard for multiauthor site
- shortcode doesn’t work
- Template plugin for blog posts? [closed]
- Filter or action hook to insert content on admin pages before tag
- Is there any good tutorial to write custom login, registration and password recovery forms? [closed]
- How to edit/delete single row items in a table on my own menu page
- WordPress plugin form not saving data
- jQuery Plugin to use WordPress functions in AJAX request
- Change wording of admin menu item?
- Cannot access wp-admin after disabling all plugin
- Add form fields dynamically on button click
- How to trigger $_GET request within admin plugin page?
- Which plugin will let me decide what users have access to on their side bar in wp-admin?
- Retrieving a Value from a wp-database
- Custom CSS for plugin form
- Form doesn’t submit on second submit call
- What would be the advantages/disadvantages of remote plugin installation?
- WP plugins for building a database?
- Layout Plugin Admin Pages: Use BootStrap? [closed]
- Remove Duplicator plugin from admin menu if not an administrator
- Doubt using $wpbd->get_col for a single column
- Image upload and other options in the same plugin settings form?
- Add a custom form on the post-new.php admin page
- When using Simple Fields plugin, how do I pull the information out of the database to display on a page?
- Creating an online questionnaire form – by Importing the questions from a spreadsheet?
- Using a custom plugin to capture input data via Ajax and PHP
- WordPress WPforms customization
- Admin accounts unable to see plugins from external IP
- WordPress wp-admin/network/plugin-install
- how to access all user dashboard on fronted page [closed]
- How to set add question capability for author role in wp pro quiz plugin
- How to insert HTML/JavaScript form into WordPress page? [closed]
- How do I make a child theme I made POST through a 3rd party plugin?
- do_action() hook into load-(page)
- How to fetch form data and show it to my page?
- Submit custom form from post content and execute in plugin
- Char limit on custom blog-post form? [closed]
- What’s causing this error? “Warning: Invalid argument”
- easy steps to make front end form without plugin
- Form that generates an ID for the customer
- Editing a text file from plugin menu
- Ajax Plugin Not Echoing Response
- Plugin that will output submitted form data for user? [closed]
- 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?
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- Remove value from array within post meta ajax admin
- Add logo to admin menu in my plugin
- add_meta_box creating default form field types
- Form Plugin for Api Requests which is used via Shortcode
- Echo out element to another page.
- Plugin permissions for Editor role
- Error: Can´t access facebook comment plugin admin page
- 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
- Gathering all Custom Post Type posts in to array/object the proper way
- Looking for a simple checkout plugin [closed]
- Adding a jQuery modal dialog to the admin area
- How to create a plugin page that shows XML?
- get wpforms ID value from ACF text field
- 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?
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- WordPress search input in database, to edit information via form and update the database
- Hide all Admin Notices and move on a separate page
- WPForms Custom Redirect not working
- How can I implement radio buttons with icons in Contact form 7?
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- Page takes on two different formats
- get/show Last ID
- How to enable Admins to see Plugins
- Create user assessment and use results in sql query
- Saving custom form fields
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- Undefined variable _POST
- How to create plugin list groups?
- How to prevent page load on form submission
- How to develop an extension for a simple form post and post back? [closed]
- What is the recommended way to be notified of security updates to my plugins? [closed]
- Why plugin’s icon for the menu not found?
- Is it possible to set different payment gateway on each Gravity Forms form? [closed]
- How to Allow Users to Select Recipients In a WordPress Comment section?
- Allow direct access to files/folders within WordPress to replace wp-admin
- Form with response button after on table after submission
- Tips on using a custom template with Ultimate Member
- Can’t save formdata in DB