Skip to content

Instantly share code, notes, and snippets.

@trey8611
trey8611 / append_acf_repeater_data.md
Last active December 3, 2024 16:47
WP All Import & ACF Add-On - How to append data to repeaters | pmxi_saved_post

Append ACF Repeater Data

It's not possible to append a row to an ACF repeater field without a custom code workaround that utilizes our API: http://www.wpallimport.com/documentation/developers/action-reference/.

The following is an example to show you how this can be done. You will almost certainly need to adjust the code snippet to make it work with your data/site.

  1. Create a new "Manual Record Matching" import that updates the post(s): http://www.wpallimport.com/documentation/recurring/manual-record-matching/

  2. Store the ACF data in your own dummy custom field: http://d.pr/i/3Si4ad.

@cliffordp
cliffordp / functions.php
Created June 21, 2018 21:27
The Events Calendar: Remove the "Search" / "Keyword" field from the Tribe Bar.
<?php
/**
* The Events Calendar: Remove the "Search" / "Keyword" field from the Tribe Bar.
*
* @link https://gist.github.com/cliffordp/797ee70c0978850e01bdbe0a9efdeef3 This snippet.
* @link https://cl.ly/1i3B1X373s1T Screenshot before.
* @link https://cl.ly/3d0K2C2A2t2U Screenshot after.
*
* @see tribe_events_get_filters
*/
@cliffordp
cliffordp / functions.php
Last active September 24, 2020 15:56
Events Calendar PRO: Remove PRO Additional Fields from displaying on Single Events page.
<?php
/**
* Events Calendar PRO: Remove PRO Additional Fields from displaying on Single
* Events page.
*
* Because the template for Additional Fields is loaded via anonymous class (no
* instance to reference), we still load the template for it, but we cause the
* output to be blank.
*
@cliffordp
cliffordp / functions.php
Last active August 23, 2018 05:06
The Events Calendar: Get all the Upcoming Events assigned a specific Event Category.
<?php
/**
* The Events Calendar: Get all the Upcoming Events assigned a specific Event Category.
*
* A utility function to be used as part of a bigger customization.
*
* @link https://gist.github.com/cliffordp/62360de9f1cb2b7b55b9bed080c173a6 This snippet.
* @link https://theeventscalendar.com/knowledgebase/using-tribe_get_events/
*
@barryhughes
barryhughes / remove-featured-events.php
Created May 3, 2018 19:16
Removes featured events from event queries, unless the query is specifically for featured events
@stianandreassen
stianandreassen / acf_wysiwyg_height.php
Last active March 4, 2025 09:16
Add a height field to ACF WYSIWYG Field
<?php
/**
* Add height field to ACF WYSIWYG
*/
function wysiwyg_render_field_settings( $field ) {
acf_render_field_setting( $field, array(
'label' => __('Height of Editor'),
'instructions' => __('Height of Editor after Init'),
'name' => 'wysiwyg_height',
'type' => 'number',
@cliffordp
cliffordp / functions.php
Last active February 26, 2020 21:55
The Events Calendar: Change Event Archives' iCalendar export links to webcal://
<?php
/**
* The Events Calendar: Change Event Archives' iCalendar export links to webcal://
*
* This causes the "iCal Export" button to recommend to calendar applications
* (e.g. Apple, Outlook, etc.) that they should *subscribe* instead of *download*.
*
* We have to use JavaScript instead of PHP because the "Export Events"
* iCalendar link gets built via JS via
* /wp-content/plugins/the-events-calendar/src/resources/js/tribe-events.min.js
@FranciscoG
FranciscoG / acf_repeater_shortcode.php
Last active April 17, 2025 12:07
An Advanced Custom Fields shortcode that allows to loop through a field with a repeater. This only handles simple cases, it can't handle nested repeater fields
<?php
/**
* ACF Pro repeater field shortcode
*
* I created this shortcode function because it didn't exist and it was being requested by others
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/
*
* @attr {string} field - (Required) the name of the field that contains a repeater sub group
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc
@cliffordp
cliffordp / functions.php
Created March 20, 2018 06:06
The Events Calendar: Eventbrite Tickets: Customize the iframe's height.
<?php
/**
* The Events Calendar: Eventbrite Tickets: Customize the iframe's height.
*
* Since Eventbrite Tickets version 4.4.6.
*
* @see Tribe__Events__Tickets__Eventbrite__Template::the_tickets()
*
* @link https://gist.github.com/cliffordp/d1b96a03b12a74e0bd7676a46523dc9a
@cliffordp
cliffordp / functions.php
Created March 1, 2018 06:06
The Events Calendar: Replace ">" with "in" at Event Category title pages.
<?php
/**
* The Events Calendar: Replace ">" with "in" at Event Category title pages.
*
* @see tribe_get_events_title()
*
* @link https://theeventscalendar.com/support/forums/topic/change-the-symbol-between-title-upcoming-events-and-category/
* @link https://gist.github.com/cliffordp/6a5883ba21441b7d002cf034f741a6da
*/