View add-yoast-redirect.php
<?php | |
/** | |
* Create a new redirect within the Yoast redirect system. | |
* | |
* @param string $orgin_url redirecting from. | |
* @param string $destination_url redirecting to. | |
* @param int $type redirect code, defaults to 301. | |
* @param string $format the format, either 'plain' or 'regex', defaults to 'plain'. | |
* @return void | |
*/ |
View remove-genesis-layout-settings-from-customizer.php
<?php | |
// Remove layout settings from customizer | |
add_filter( 'genesis_customizer_theme_settings_config', 'jdn_filter_genesis_customizer_theme_settings' ); | |
function jdn_filter_genesis_customizer_theme_settings( $config ) { | |
if( isset( $config['genesis']['sections']['genesis_layout'] ) ) | |
unset( $config['genesis']['sections']['genesis_layout'] ); | |
return $config; |
View grid-block.scss
.grid-block { | |
float: left; | |
} | |
.grid { | |
$grid-gap: 9px; | |
// Columns! | |
@media screen and ( min-width: 600px ) { // responsive grid | |
display: grid; |
View change-wp-user-password.sql
UPDATE wp_users | |
SET user_pass = MD5('newpassword') | |
WHERE ID = 55; |
View custom-route-notification-multiple-fields.php
<?php | |
/** | |
* Change the sent to email address in the notification | |
* | |
* @author Joshua David Nelson, josh@joshuadnelson.com | |
**/ | |
// 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 ) { | |
View gist:57210d6218e4039288973d0045a10159
<?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 | |
*/ |
View gf-upload-file-to-post-attachment.php
<?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, josh@joshuadnelson.com | |
*/ | |
$gravity_form_id = 1; // gravity form id, or replace {$gravity_form_id} below with this number |
View gf-upload-file-to-media-library.php
<?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, josh@joshuadnelson.com | |
*/ | |
$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 ) { |
View gravity-form-to-acf-image-field-fornt-end-posting.php
<?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 |
NewerOlder