Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Plugins

    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Formsโ€”everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies

    How to build...

    • Property Management
    • Product Catalog
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Pricing
  • About
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityMigrate
    • GravityRevisions
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GF Zero Spam
    • GravityExport Lite

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityMigrate
      • GravityRevisions
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GF Zero Spam
      • GravityExport Lite
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
    • Contact

    Uncategorized

    • About the `secret` shortcode attribute
    • Adding custom repeat schedules to the Event field
    • Adding GravityKit support emails to your allowlist
    • Bulk Edit Step: What are these fields?
    • Bulk Edit Step: What will happen to my old field data?
    • Fields in GravityExport
    • GravityBoard + GravityView Integration
    • GravityExport download URL shortcode
    • GravityExport Lite: Recipes
    • GravityKit Add-On Shortcodes (a complete reference)
    • How to disable entry creation in Gravity Forms
    • If GravityKit blocks are not visible in the block editor inserter
    • If you see a “This link has expired” or “Are you sure you want to do this?” message when installing a plugin
    • Import Step: Mapping CSV columns to form fields
    • Modifying Chart.js settings with filters
    • Showing fewer overlapping events in GravityCalendar
    • Troubleshooting 403 errors in GravityBoard
    • Home
    • Docs
    • Uncategorized
    • Adding custom repeat schedules to the Event field

    Adding custom repeat schedules to the Event field

    Estimated reading: 7 minutes

    Updated on April 24, 2026

    Adding custom repeat schedules to the Event field

    Learn how to extend the Gravity Forms Event field with custom repeat frequency options using WordPress filters.

    The Event field includes standard repeat frequency options (daily, weekly, monthly, yearly), but you can add custom schedules like “Every 3rd Monday” or “Last Friday of the month” using the developer filter system.


    Prerequisites #

    Before you begin, ensure that you have:

    • The Gravity Forms Event field plugin installed and activated
    • Basic knowledge of WordPress hooks and filters
    • Access to your site’s functions.php file or ability to create a custom plugin

    Understanding the filter system #

    The Event field uses a filter-based system that allows developers to extend repeat frequency options. The system includes:

    • gk/event-field/repeat-options – Adds custom options to the repeat frequency dropdown
    • gk/field-event/cron-value – Converts custom selections to cron expressions for scheduling

    Step 1: Add custom repeat options #

    Add new options to the repeat frequency dropdown using the gk/event-field/repeat-options filter.

    “`php <?php /** * Add custom repeat frequency options to the Event field. * * This function extends the default repeat frequency dropdown with custom scheduling * options like “Every 3rd Monday” and “Last Friday of the month”. The custom options * are merged with the existing default options (daily, weekly, monthly, yearly). * * @since 1.0.0 * * @param array $options The default repeat frequency options. * Contains key-value pairs where keys are * option values and values are display labels. * @param \GravityKit\EventField\EventField $field The current EventField instance. * Provides access to field properties and methods. * * @return array Modified options array with custom schedules added. * Maintains the original structure with additional custom options. */ function add_custom_event_repeat_options( $options, $field ) { // Add custom schedule options with translatable labels $custom_options = [ ‘third_monday’ => __( ‘Every 3rd Monday’, ‘textdomain’ ), ‘last_friday’ => __( ‘Last Friday of the month’, ‘textdomain’ ), ‘first_tuesday’ => __( ‘First Tuesday of the month’, ‘textdomain’ ), ];

    // Merge custom options with existing default options
    return array_merge( $options, $custom_options );

    } add_filter( ‘gk/event-field/repeat-options’, ‘add_custom_event_repeat_options’, 10, 2 ); “`


    Step 2: Convert custom options to cron expressions #

    Use the existing gk/field-event/cron-value filter to convert your custom repeat options into valid cron expressions.

    “`php <?php /** * Convert custom repeat frequency options to cron expressions. * * This function intercepts the cron array generation process and modifies it * for custom repeat frequency options. It reads the selected frequency from * the form submission and applies the appropriate cron pattern modifications. * * @since 1.0.0 * * @param array $cron { * The cron array containing scheduling components. * * @type string $minute Minute component (0-59, *, or pattern). * @type string $hour Hour component (0-23, *, or pattern). * @type string $day_month Day of month component (1-31, *, L, or pattern). * @type string $month Month component (1-12, *, or pattern). * @type string $day_week Day of week component (0-6, *, L, #, or pattern). * } * * @return array Modified cron array with custom schedule patterns applied. * Returns the original array if no custom schedule is detected. */ function handle_custom_event_cron_values( $cron ) { // Get the selected repeat frequency from the form submission $current_field_id = rgget( ‘id’ ); // Get the current form ID from query parameters $repeat_input_name = “input_{$current_field_id}_7”; // Field ID 7 is the repeat field $selected_frequency = rgpost( $repeat_input_name );

    // Convert custom frequencies to cron expressions
    switch ( $selected_frequency ) {
        case 'third_monday':
            // Every 3rd Monday: minute hour day_month month day_week
            $cron['day_week'] = '1#3'; // Monday (1) on the 3rd occurrence (#3)
            break;
    
        case 'last_friday':
            // Last Friday of the month
            $cron['day_week'] = '5L'; // Friday (5) on the last occurrence (L)
            break;
    
        case 'first_tuesday':
            // First Tuesday of the month
            $cron['day_week'] = '2#1'; // Tuesday (2) on the 1st occurrence (#1)
            break;
    }
    
    return $cron;

    } add_filter( ‘gk/field-event/cron-value’, ‘handle_custom_event_cron_values’ ); “`


    Cron expression reference #

    Understanding cron syntax helps you create precise scheduling patterns:

    | Field | Values | Special Characters | |——-|——–|——————-| | Minute | 0-59 | * , – / | | Hour | 0-23 | * , – / | | Day of month | 1-31 | * , – / ? L | | Month | 1-12 | * , – / | | Day of week | 0-6 (Sun=0) | * , – / ? L # |

    Special characters for advanced scheduling

    • # – Nth occurrence (e.g., 1#3 = 3rd Monday)
    • L – Last occurrence (e.g., 5L = Last Friday)
    • */n – Every nth interval (e.g., */2 = Every 2nd occurrence)
    • , – List separator (e.g., 1,3,5 = Monday, Wednesday, Friday)
    • - – Range (e.g., 1-5 = Monday through Friday)

    Best practices #

    Code organization

    1. Create a custom plugin instead of adding code to functions.php for better maintainability.

    2. Use proper text domains for translation-ready strings.

    3. Add docblocks to all functions for documentation.

    4. Validate user input to prevent invalid cron expressions.

    Performance considerations

    1. Cache complex calculations if your custom schedules require intensive processing.

    2. Limit the number of custom options to prevent dropdown bloat.

    3. Test cron expressions thoroughly before deploying to production.

    User experience

    1. Use clear, descriptive labels for custom repeat options.

    2. Group related options logically in the dropdown.

    3. Provide documentation for site administrators using custom schedules.


    Troubleshooting #

    Common issues

    Custom options don’t appear in dropdown – Verify the filter is added correctly with proper priority – Check that your code is executed on form display pages – Ensure there are no PHP errors preventing filter execution

    Cron expressions not working as expected – Validate cron syntax using online cron expression validators – Test with simple patterns before implementing complex schedules – Verify that your hosting environment supports the required cron features

    Events not repeating correctly – Check that the cron expression is properly formatted – Ensure the calendar system (like GravityCalendar) supports your custom patterns – Verify timezone handling for complex schedules

    Testing custom schedules

    “`php <?php /** * Debug function to test cron expression generation for custom schedules. * * This utility function helps developers test and validate their custom repeat * schedules by simulating form submissions and logging the generated cron expressions. * It’s designed for development and debugging purposes only and includes proper * capability checks to prevent unauthorized usage. * * @since 1.0.0 * * @return void Outputs debug information to error log, no return value. */ function debug_custom_event_schedules() { // Security check: only allow administrators to run debug function if ( ! current_user_can( ‘manage_options’ ) ) { return; }

    // Define test cases for various custom schedule types
    $test_cycles = [ 'third_monday', 'last_friday', 'first_tuesday' ];
    
    // Iterate through each test case to generate and log cron expressions
    foreach ( $test_cycles as $cycle ) {
        // Simulate form submission data for testing
        $_POST["input_1_7"] = $cycle;
    
        // Initialize default cron array structure
        $cron = [
            'minute'    =&gt; '00',
            'hour'      =&gt; '09',
            'day_month' =&gt; '*',
            'month'     =&gt; '*',
            'day_week'  =&gt; '*',
        ];
    
        // Apply filters to generate custom cron expression
        $result = apply_filters( 'gk/field-event/cron-value', $cron );
        $expression = implode( ' ', $result );
    
        // Log results for debugging and validation
        error_log( "Custom Schedule Debug - Cycle: {$cycle} -&gt; Generated Cron: {$expression}" );
    }
    
    // Clean up test data
    unset( $_POST["input_1_7"] );

    } // Uncomment the following line to enable debugging: // add_action( ‘init’, ‘debug_custom_event_schedules’ ); “`


    Related articles #

    • Event field configuration guide
    • GravityCalendar integration setup
    • WordPress cron system overview
    • Gravity Forms filter reference

    > Note: Custom repeat schedules require the Event field plugin version 1.5.0 or higher. All code examples follow WordPress coding standards and include proper error handling.

    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous รฉcrire dans votre langue maternelle si cโ€™est plus facile pour vousโ€”nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta mรกs fรกcil; ยกnosotros nos encargamos de la traducciรณn!
    Sie kรถnnen uns in Ihrer Muttersprache schreiben, wenn das fรผr Sie einfacher ist โ€“ wir kรผmmern uns um die รœbersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is โ€” wij zorgen voor de vertaling!
    Du kan skrive til oss pรฅ ditt morsmรฅl hvis det er enklere for deg โ€” vi tar oss av oversettelsen!
    Du kan skriva till oss pรฅ ditt modersmรฅl om det รคr lรคttare fรถr dig โ€” vi tar hand om รถversรคttningen!
    Vocรช pode nos escrever em seu idioma nativo se for mais fรกcil para vocรช โ€” nรณs cuidaremos da traduรงรฃo!
    Puoi scriverci nella tua lingua madre se ti รจ piรน facile โ€” penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Stay informed?

      Was this page helpful?

      Table Of Contents
      • Prerequisites
      • Understanding the filter system
      • Step 1: Add custom repeat options
      • Step 2: Convert custom options to cron expressions
      • Cron expression reference
      • Best practices
      • Troubleshooting
      • Related articles
      GravityKit
      • How to Build It
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (โ€œTermsโ€)
      About Us
      • GravityKit on Mastodon
      • GravityKit on Twitter
      • GravityKit Training Courses
      • GravityKit on Facebook
      • Join our Facebook Group
      • Facebook
      • Twitter
      Get notified of updates.

      Weโ€™re constantly improving GravityKit. Fill out your email below and weโ€™ll notify you anytime major updates drop.

      GravityKit is a Gravity Forms Certified Developer.

      Copyright ยฉ 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.