Hope I did get it right:
<?php
function specialValidation($value) {
$explode = explode(' ', $value);
if(sizeof($explode) > 1) {
echo 'ERROR: You have input more than one word.';
return;
}
$mustBeS = substr($explode[0],0,1);
if($mustBeS != 's' && $mustBeS != 'S') {
echo 'ERROR: Your word must start with an "s" or "S".';
return;
}
}
Related Posts:
- Integrate Razorpay quick payments plugin with contact form7 plugin
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Keep one user logged for a year?
- Customizing subject in comment notification e-mails
- if plugin is active? check if plugin is enabled or not?
- WP showing “warning: call_user_func_array()”, What to do?
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- Saving Plugin settings to the database
- Change destination author link
- How to turn off email you receive when registered?
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- How can i change an image’s author?
- Server side validation for Contact Form 7 [closed]
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- Display a text message if the field is not found and not if found
- Scope for PHP Variables Assigned in functions.php or a plugin
- Add a plugin before main container
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- Missing argument 3 for wp_register_sidebar_widget()
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Shortcode button dosent work for all posts. Work for first post only
- wordpress plugin is not activating from widget
- Edit Yoast SEO breadcrumbs output [closed]
- Override Plugin Script Fucnction in WordPress
- Shrink down register_settings on Settings API
- Replacing a plugin function with a custom renamed function doesn’t work
- How to call WordPress function other files
- All sites themes functions.php have been changed
- Conditional attributes and logic per product category
- Redirect to another page using contact form 7? [closed]
- Load Javascript from Plugin in One Page Only?
- Checking the count within a foreach loop
- Help with WP Business Directory Manager Plugin?
- wp_dequeue_script for a Plugin
- Need to replace Currency Shortforms
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- WordPress Stock Update Programatically
- How to translate wordpress error message
- Api external with wordpress
- All custom widgets are not showing in widget area at the same time
- same user role or copy the user role to be same as the other role
- Different registration form for different roles
- More gentle way to hook WordPress custom url
- Can you echo PHP code from a variable?
- Checkbox show / hide output result
- Custom Logo Link WordPress
- How to convert Currency from USD to other IP Based currency in Php function
- how to validate input field in wordpress generated with wpform plugin
- add_rewrite_rule to load different page, without changing URL in browser
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- Attempting to list all product categories and the price range of all products within them
- Push Contact form 7 variable to front end after submission
- Creating an array from form inputs before it is posted to the options database
- Share my WordPress plugin for updating how?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- Submitting form to PHP
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Get Shortcode output to database for static post_content
- working code, not working – Plugin Dev
- Change custom rewrite rule when permalink is updated/changed
- Configuring default woo commerce login with modal popup
- Compare Ajax Data Results
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- register_activation_hook doesn’t fire at all
- Nested DIV’s across functions in PHP, do not seem to work
- My ajax request don´t work and return 0
- Populate select option with JSON file
- Every time I use wp_get_current_user() my plugin breaks
- Find all strings between an enclosing shortcode
- Create csv file in plugin
- Posting code inside the post instead of in the template file using shortcode
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- Metabox Data not saving
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- Including a PHP file via a function that is part of a plugin?
- How to disable register and reset the password from WordPress admin panel?
- Move related products after product summary? [closed]
- How to tweak a plugin without preventing it from updating
- Adminimize Plugin — Is there an alternative to limiting Editor to ‘Appearance > Widgets’ only?
- How to do Conact form 7 name field validation? [closed]
- Woocommerce disable checkout on specific day
- Requires PHP version 5.3.0
- Adding a script & php to functions.php
- Option value not getting updated until page refresh in WordPress
- Make plugin admin page visible to other roles
- How to change all the urls of the WordPress site?
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- I want to allow certain file types on dokan upload files
- stop resize button for wordpress media
- Mixed results with is_page() WordPress function, when using $this, or self
- Read page- or post-content across different builder-plugins