This file contains hidden or 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: Update Image Alt Text in All Blocks (Multisite + Custom Blocks) | |
* Description: WP-CLI command to update alt text in all images inside blocks for all sites in a multisite network, including custom blocks. | |
*/ | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
class Network_Update_All_Image_Alts_Command { |
This file contains hidden or 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: Sync Attachment Meta | |
* Description: Sync attachment titles and alt text across multisite sites. Choose a source site to pull titles and alt text from, and have matching attachments updated on all other sites. | |
* Version: 1.0.0 | |
*/ | |
// Confirm that WP-CLI is available. | |
if ( defined( 'WP_CLI' ) && WP_CLI ) { |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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='[email protected]' | |
blueprint='BLUEPRINT-NAME' | |
clear |
This file contains hidden or 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 hidden or 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' ); |
NewerOlder