This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change the sent to email address in the notification | |
* | |
* @author Joshua David Nelson, [email protected] | |
**/ | |
// Route to user address from drop down list, update the '1' to the ID of your form | |
add_filter( 'gform_notification_1', 'route_user_email_notification', 10, 3 ); | |
function route_user_email_notification( $notification, $form , $entry ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WDS GIF API | |
* Plugin URI: http://webdevstudios.com | |
* Description: Adds a Custom Post Type to store GIFs and an API JSON Endpoint to access GIFs by a tag. | |
* Author: WebDevStudios | |
* Author URI: http://webdevstudios.com | |
* Version: 1.0.0 | |
* License: GPLv2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Associate an uploaded file with a post on form submission in Gravity Forms | |
* | |
* This is specific to a comment on my post about connecting GF with ACF | |
* | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/#comment-13186 | |
* @author Joshua David Nelson, [email protected] | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create a new media library entry with a file upload on gravity form submission. | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/ | |
* @author Joshua David Nelson, [email protected] | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_add_image_to_media_library', 10, 2 ); | |
function jdn_add_image_to_media_library( $entry, $form ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Connect a Gravity Form File Upload Field to an ACF Image Field. | |
* @see https://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/ | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number | |
add_filter( "gform_after_submission_{$gravity_form_id}", 'jdn_set_acf_gallery_field', 10, 2 ); | |
function jdn_set_acf_gallery_field( $entry, $form ) { | |
$gf_images_field_id = 7; // the upload field id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the responsive image. | |
* | |
* @param string $image_id | |
* @param string $image_size optional | |
* | |
* @return string $output | |
*/ | |
function get_responsive_image( $image_id, $size = 'medium' ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Route to user address from drop down list, update the '1' to the ID of your form – I am using this on 6 forms so I have removed the ID requirement | |
add_filter( 'gform_notification', 'welcome_email', 10, 3 ); | |
function welcome_email( $notification, $form , $entry ) { | |
foreach( $form['fields'] as &$field ) { | |
// Similar to above, find the right field | |
if( $field['type'] != 'select' || strpos($field['cssClass'], 'user-emails') === false ) | |
continue; | |
// Pull out the user id selected, by the field id and the $entry element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Commit on Update | |
* Plugin Author: Joshua David Nelson | |
**/ | |
defined( 'ABSPATH' ) or die( 'Nope!' ); | |
class Commit_On_Update { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Allow shortcodes in genesis archive intro text. | |
* | |
* @author Joshua David Nelson, [email protected] | |
**/ | |
// Custom Post Type Archive Intro Text | |
add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode' ); |