Snippet library
WordPress code snippets, ready to use.
707 free & Pro snippets and modules. Copy-paste-ready, or import in one click with SnipCraft.
EDD: Empty Cart Link Shortcode
Registers a [scseed_edd_empty_cart] shortcode that outputs a link customers can click to clear their entire EDD shopping cart.
EDD: Redirect to Custom Page After Successful Purchase
Redirects customers to a custom thank-you page after an EDD purchase completes instead of the default EDD success page.
EDD: Auto-Complete Free (Zero-Total) Purchases
Automatically transitions EDD payments with a zero total from pending to complete, skipping manual fulfilment for free downloads.
EDD: Skip Cart and Go Straight to Checkout
Bypasses the EDD cart page entirely and sends customers directly to the checkout page when they click a purchase button.
EDD: Change Add-to-Cart Button Text
Replaces the default "Add to Cart" label on EDD download purchase links with custom text site-wide.
ACF: Hide a Field Group from Non-Admins
Hides every field belonging to a specific ACF field group from users who do not have the manage_options capability by returning false from acf/prepare_field.
ACF: Enable ACF Fields in the REST API
Enables ACF's built-in REST API support (requires ACF 5.11+) so custom field values are exposed under the 'acf' key on post, term, and user REST responses.
ACF: Display Repeater Rows via Shortcode
Registers a [scseed_acf_repeater field="my_repeater" sub="item"] shortcode that iterates a repeater field and outputs its rows as a list.
ACF: Sync Field-Group JSON to a Custom Folder
Redirects ACF's JSON save/load paths to an acf-json folder inside the active theme, keeping field-group definitions in version control.
ACF: Auto-Generate Post Title from ACF Fields
After ACF saves a 'scseed_person' post, automatically sets its title and slug to the concatenated 'first_name' and 'last_name' field values.
ACF: Make a Field Read-Only in Admin
Marks an ACF field named 'scseed_generated_id' as disabled and read-only in the admin edit screen so it cannot be changed manually.
ACF: Set Field Default Value Dynamically
Sets a programmatic default for an ACF date field named 'scseed_publish_date' to today's date when the field has no saved value.
ACF: Populate Select Choices from Post Categories
Dynamically fills an ACF select field named 'scseed_category_picker' with all registered post categories, keeping choices in sync automatically.
ACF: Display Field Value via Shortcode
Registers a [scseed_acf_field name="field_name"] shortcode that outputs a single ACF field value, safely escaped for display.
ACF: Hide ACF Admin Menu for Non-Admins
Hides the ACF admin menu item from all users who do not have the manage_options capability, keeping the UI clean for editors.
ACF: Set Google Maps API Key
Configures the Google Maps API key used by ACF map fields via a constant placeholder — replace the constant value with your real key.
ACF: Register an Options Page
Registers a top-level ACF options page in the WordPress admin so site-wide settings can be managed through custom fields.
Elementor: Register Custom Icon Library in the Icon Picker
Adds a custom icon font library tab to the Elementor icon picker so theme-specific icon sets appear alongside the built-in Font Awesome libraries.
Elementor: Dequeue Assets on Non-Elementor Pages
Removes Elementor frontend CSS and JS from pages not built with Elementor, cutting page weight on standard theme pages.
Elementor: Disable Font Awesome 4 Compatibility Shim
Prevents Elementor from loading the FA4 backward-compatibility shim, reducing page weight on sites that only use Font Awesome 5 or 6 icons.
Elementor: Enqueue Custom Stylesheet in the Elementor Preview
Injects a custom stylesheet into the Elementor live-preview iframe so design changes match the live site appearance in real time.
Elementor: Enqueue Custom Scripts in the Elementor Editor
Loads a theme stylesheet and script file inside the Elementor editor panel for adding editor-side UI enhancements or styling tweaks.
Elementor: Wrap Elementor Frontend Content Output
Filters the final rendered Elementor page content to add a custom wrapper div, useful for scoped CSS or JavaScript targeting.
Elementor: Add Body Class on Elementor-Built Pages
Appends a has-elementor-page CSS class to the body tag on any singular page built with Elementor, enabling targeted stylesheet overrides.