Skip to content
Fetch Designs
  • Blog
  • Sign-up Sheets
    • Sign-up Sheets Plugin
    • Documentation
    • Support
  • Services
  • Contact

Hooks (Actions and Filters)Sign-up Sheets WordPress Plugin Documentation

Login Create an Account
Home » Documentation » Sign-up Sheets WordPress Plugin » Hooks (Actions and Filters)
Documentation Menu
Skip Documentation Menu
  • Sign-up Sheets WordPress Plugin
    • Getting Started
      • Installing Sign-up Sheets Pro (and Upgrading from Free)
      • Creating a Sign-up Sheet
      • Settings
      • Manage Sign-ups
      • Task Dates
      • Copy Sheets and Tasks
      • Task Header Rows
      • Confirmation Email
      • Reminder Emails
      • User Editable Sign-ups
      • Compact, Semi-Compact, & Default Display Modes
      • Self-Removal on Sign-ups
      • Mail Sending Troubleshooting
      • Custom Fields
      • Sheet Categories
      • Export/Import Sign-up Sheets to Another WordPress Site
      • Batch Import Tasks
      • GDPR and Sign-up Sheets
    • Shortcodes
      • [sign_up_sheet] Shortcode
      • [user_sign_ups] Shortcode
      • [sign_up_spot_count] Shortcode
    • Developers
      • Caching
      • Hooks (Actions and Filters)
      • Overriding Templates in Your Theme
      • Translations
Back to top of Documentation Menu

WordPress hooks that have been built into the Sign-up Sheets plugin are detailed here. You may find other hooks built within the Sign-up Sheets plugin codebase, but only the ones listed below are expected to be supported now and into the future. Undocumented hooks may be subject to change without notice in future versions.

Modifies the state dropdown array on the sign-up form. By default this array is formatted like…

$states = array(
    'AL' => 'Alabama',
    'AK' => 'Alaska',
    //...
)

Example

The example below adds a new option to the end of the states dropdown field.

add_filter('fdsus_states', 'my_states');

/**
 * Filter for states dropdown array
 *
 * @param string $sql
 *
 * @return string
 */
function my_states($states)
{
    $states['NEW'] = 'My New State';
    return $states;
}

Source

File: model/states.php

/**
 * Filter for states dropdown array
 *
 * @param string $sql
 *
 * @return string
 * @since 2.2
 */
return apply_filters('fdsus_states', $states);

Example

The example below shows how you can add an additional check prior to saving the signup to include your own custom form validation before the sign-up is added.

add_filter('fdsus_error_before_add_signup', 'my_error_before_add_signup');

/**
 * Do something after a signup is added
 *
 * @param string $errorMsg
 * @param int    $taskId
 * 
 * @return string
 */
function my_error_before_add_signup($errorMsg, $taskId)
{
    if ($_POST['foo'] !== 'bar') {
        $errorMsg = 'Darn, something failed."
    }

    return $errorMsg;
}

Source

File: controller/scode/sign-up-form.php

/**
 * Filter the error check that runs when processing the signup form before the new signup is added
 * to the DB
 *
 * @param string $errorMsg
 * @param int    $taskId
 *
 * @return string
 * 
 * @api
 * @since 2.2
 */
$errorMsg = apply_filters('fdsus_error_before_add_signup', $errorMsg, $taskId);

Example

The example below shows how you can add code to do something when a new sign-up is added.

add_action('fdsus_after_add_signup', 'my_after_add_signup');

/**
 * Do something after a signup is added
 *
 * @param int $signupId
 */
function my_after_add_signup($signupId)
{
    if ($signupId) {
        // do something
    }
}

Source

File: controller/scode/sign-up-form.php

/**
 * Action that runs after the signup is successfully added
 *
 * @param int $signupId
 *
 * @api
 * @since 2.2
 */
do_action('fdsus_after_add_signup', $signupId);

Example

The example below shows how you can set your own custom success message. This is a simplified example that just returns a string of text, but you are also provided with the default success message $successMsg along with the $task and optional $signup objects to return a more dynamic message as needed.

add_action('fdsus_signup_success_message', 'my_custom_success_msg', 10, 3);

/**
 * Set custom success message
 *
 * @param string            $successMsg The content that will be displayed in the notice
 * @param TaskModel         $task       Task object that was signed up for
 * @param SignupModel|false $signup     Signup object (optional)
 */
function my_custom_success_msg($successMsg, $task, $signup = false)
{
    return 'You have signed up. Yay!';
}

Source

File: controller/sheet.php

/**
 * Filters the Sign-up Form success notice content.
 * May display as one or more on a page depending on how may tasks are signed up for
 *
 * @param string            $successMsg The content that will be displayed in the notice
 * @param TaskModel         $task       Task object that was signed up for
 * @param SignupModel|false $signup     Signup object (optional)
 *
 * @api
 * @since 2.1.5.3
 */
$successMsg = apply_filters('fdsus_signup_success_message', $successMsg, $task, $signup);

Blog Search

Recent Posts

  • Create Magento Custom Frontend Route
  • Install Magento 2 on Mac OSX Running MAMP
  • Cleanup Git Branches Already Merged into Master
  • Add Custom Image Field to WordPress Theme Customizer
  • Disable WHM Two-Factor Authentication via Command Line

Categories

  • Apache
  • CentOS
  • Command Line (CLI)
  • DNS
  • Git
  • iOS
  • JavaScript
  • jQuery
  • LAMP
  • Linux
  • Mac OSX
  • Magento
  • Magento 2
  • Mail
  • MAMP
  • MySQL
  • PHP
  • Python
  • SPAM
  • Tips
  • Tutorial
  • WHM
  • WordPress
  • Accessibility Statement
  • Privacy Policy
  • Contact

© 2025 Fetch Designs. All rights reserved.