Skip to content

Instantly share code, notes, and snippets.

View aibrean's full-sized avatar

April Sadowski aibrean

View GitHub Profile
@aibrean
aibrean / acf-field-counter.php
Created March 11, 2016 17:06 — forked from emaildano/acf-field-counter.php
ACF field counter snippet.
<?php
// get the count on the repeater field
// mabye use get_sub_field() instead of get_field() if it's nested
$count = count( get_sub_field( 'the_field' ) );
// begin $count conditions
if ( $count > 1 ) { ?>
// greater than 1
<?php the_field( 'great_than_1' ); ?>
<?php } else { ?>
@aibrean
aibrean / send-invoice-email-on-publish.php
Created March 13, 2016 16:17 — forked from renventura/send-invoice-email-on-publish.php
Send email when invoice post is created. This uses a hook specific to the Advanced Custom Field plugin.
<?php //* Mind this opening PHP tag
/**
* Send an email to the invoice_client_email custom field in the Invoice post type
* The acf/save_post hook is specific to the Advanced Custom Fields plugin
*
* @author Ren Ventura
* @link http://www.engagewp.com/create-invoices-gravty-forms-wordpress
*/