Archives: Snippets

  • Allow Selection of All CPTs in APC Feed

    By default, the Advanced Post Creation add-on only surfaces publicly registered custom post types in the feed settings. This removes the public argument from the get_post_types() query, allowing both public and non-public CPTs to appear as options.

  • Change Submit Button Text on Click to “Processing…”

    Appends an onclick handler to the Gravity Forms submit button that swaps its label to “Processing…” the moment the user clicks it, providing immediate feedback while the form submits.

  • Sort Form List by Newest First

    Reorders the Forms list table in the WordPress admin to show the most recently created forms first by default, sorting by descending form ID when no explicit orderby is set in the URL.

  • Show Optional Rather Than Required

    Changes the default behavior of Gravity Forms to show “Optional” for non-required fields rather than “Required” for required fields.

  • Restrict Form Shortcode Output by User Role

    Adds a custom roles attribute to the shortcode that restricts the rendered form to users with one of the specified WordPress roles. Logged-out users and users without a matching role see a fallback message instead of the form.

  • Use Placeholder for Radio “Other” Choice

    Replaces the default Other value on a Radio field’s “Other” choice with an empty value and a placeholder attribute, so the input appears as a hint instead of pre-filled text the user must clear.

  • Prevent Paste in Confirm Email Field

    Prevents pasting into the confirm email input field in email fields that have confirmation enabled. Displays a browser alert when a paste action is attempted.

  • Send Notifications When an Entry Is Updated

    Registers a new “Entry Updated” notification event and triggers matching notifications whenever an entry is edited from the admin. The event becomes selectable in the notification editor’s “Event” dropdown.

  • Image Choice Original Aspect Ratio

    Re-renders Image Choice field markup to use the full-size image (with original dimensions, srcset, and sizes) when the field has the CSS class original-aspect-ratio, and overrides the default fixed aspect ratio so each choice displays at its natural ratio.

  • Export US State as Abbreviation Code

    Converts the full US state name to its two-letter abbreviation code when exporting entries containing a US-type Address field. Only affects the state sub-input (input .4) of Address fields configured with the US address type.