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
// Make pages automatically checked private in EDD, and select specific download buyers to restrict to | |
// Change val("86") to the option that you want pre-selected | |
add_action( 'admin_head', 'pw_edd_cr_admin_head', 20 ); | |
function pw_edd_cr_admin_head() { | |
echo '<script type="text/javascript">jQuery(function($){ $("#edd_cr_active_only").attr("checked", "1"); $("#edd_cr_download_id").val("86"); });</script>'; | |
} |
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 | |
/* | |
* Dynamically generate list of dates in Gravity Forms Dropdown and remove past and previously selected dates | |
*/ | |
add_filter( 'gform_pre_render', 'dl_populate_dropdown' ); | |
//Note: when changing drop down values, we also need to use the gform_pre_validation so that the new values are available when validating the field. | |
add_filter( 'gform_pre_validation', 'dl_populate_dropdown' ); |
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
/** | |
* Hook into all Gravity Form submissions, check to see if the form id | |
* matches the one we want to generate an invoice from, and process the | |
* submission if appropriate. | |
* | |
* @param arrat $entry Array of the GF entry | |
* @return null | |
*/ | |
function maybe_process_gravity_form_and_create_invoice( $entry = array(), $form = array() ) { |
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
#!/bin/bash -e | |
# Ideas, Drawbacks, and Suggestions: https://davidlaietta.com/bash-scripting-to-automate-site-builds-with-wp-cli/ | |
# Set up some defaults | |
wpuser='USERNAME' | |
email='USER@EMAIL.COM' | |
blueprint='BLUEPRINT-NAME' | |
clear |
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
/** | |
* Initializes the general settings by registering the Sections, Fields, and Settings. | |
* | |
* This function is registered with the 'admin_init' hook. | |
*/ | |
public function initialize_general_settings() { | |
// Control title of republish | |
// Set Terms text | |
// Choose CC license to use |
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 | |
/* | |
* This is a custom shortcode to allow the link to a post while using the Genesis Framework. | |
* | |
* It was created to fill the need of a loop that needed links to posts. | |
*/ | |
add_shortcode( 'post_link', 'genesis_post_link_shortcode' ); | |
/** |
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
#!/bin/zsh | |
# delete the default plugins and themes that we don't need | |
wp plugin delete hello | |
wp theme delete twentyfifteen | |
wp theme delete twentysixteen | |
# install the themes and plugins that we do want | |
wp plugin install gutenberg --activate | |
wp plugin activate akismet |
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 the Gravity form to stay on the page when confirmation displays. | |
add_filter( 'gform_pre_submission_filter', 'dw_show_confirmation_and_form' ); | |
function dw_show_confirmation_and_form( $form ) { | |
// Inserts a shortcode for the form without title or description | |
$shortcode = '[gravityform id="' . $form['id'] . '" title="false" description="false"]'; | |
// Ensures that new lines are not added to HTML Markup | |
ob_start(); |
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
/* ==UserStyle== | |
@name david's YouTube Cleanup | |
@namespace github.com/openstyles/stylus | |
@version 1.0.0 | |
@description Various Options to Cleanup YouTube. You can toggle display of full video titles, blurring out watched videos, hiding a bunch of sidebar buttons, and some body cruft, including YouTube Shorts. | |
@author david wolfpaw | |
@preprocessor stylus | |
@var checkbox show-full-titles "Show Full Titles" 1 | |
@var checkbox hide-watched-videos "Blur Watched Videos" 1 |