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
wp user list --field=ID --role=customer | xargs wp user delete --yes |
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 | |
/** | |
* Prevent the loading of patterns from the WordPress.org Pattern Directory | |
*/ | |
add_filter( 'should_load_remote_block_patterns', '__return_false' ); | |
/** | |
* Remove patterns that ship with WordPress Core. | |
*/ | |
function bbfs_remove_core_block_patterns() { |
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
{ | |
"$schema": "https://schemas.wp.org/wp/6.2/theme.json", | |
"version": 2, | |
"settings": { | |
"appearanceTools": false, | |
"border": { | |
"color": false, | |
"radius": false, | |
"style": false, | |
"width": false |
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: Delete All Subscriptions | |
Plugin URI: | |
Description: Delete all of those bad boys | |
Author: | |
Author URI: | |
Version: 1.0 | |
*/ | |
function mystic_delete_all_subscriptions() { |
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 filter to change the default validation message that Gravity Forms generates | |
add_filter('gform_validation_message', 'change_validation_message', 10, 2); | |
function change_validation_message($message, $form) | |
{ | |
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>"; | |
} | |
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back |
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
jQuery(document).ready(function($) { | |
jQuery.fn.cleardefault = function() { | |
return this.focus(function() { | |
if( this.value == this.defaultValue ) { | |
this.value = ""; | |
} | |
}).blur(function() { | |
if( !this.value.length ) { | |
this.value = this.defaultValue; |
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 just a simple loop to display 7 attachments attached to a post or page in WordPress | |
* You can change 'medium' and 'thumbnail' to add sizes you have definied in your theme by the add_image_size function | |
* in WordPress | |
*/ | |
?> | |
<div id="thumbs" class="pic_list"> | |
<ul class="thumbs"> | |
<?php /* Time to create a new loop that pulls out the first 7 image attachments for this post */ | |
$args = array( 'post_type' => 'attachment', 'numberposts' => 7, 'post_status' => null, 'post_parent' => $post->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 | |
/* gform_pre_submission will do all forms. gform_pre_submission_1 will do a form with an ID of 1 | |
* Keep an eye on the priority of the filter. In this case I used 9 because the Salesforce plugin we used ran a presubmission filter at 10 so we needed this to happen before it | |
*/ | |
add_filter( "gform_pre_submission_1", "add_salesforce_campaign_id_footer", 9 ); | |
function add_salesforce_campaign_id_footer( $form ){ | |
foreach($form["fields"] as &$field) | |
if($field["id"] == 2){ | |
/* Set the variable you want here - in some cases you might need a switch based on the page ID. | |
* $page_id = get_the_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 | |
// Append the Gravity Forms ID to the end of the filter so that the validation only runs on this form | |
add_filter('gform_validation_1', 'custom_validation'); | |
function custom_validation($validation_result){ | |
$form = $validation_result["form"]; | |
foreach($form['fields'] as &$field){ | |
/* Check that the value of the field that was submitted. e.g. the name="input_1" that is generated by Gravity Forms */ | |
if($_POST['input_1'] == "Your First Name"){ | |
// set the form validation to false | |
$validation_result["is_valid"] = false; |
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: Featured Custom Post Type Widget | |
Plugin URI: http://www.sennza.com.au | |
Description: Lists out all the custom post type posts in a dropdown so the user can selected a CPT to feature. | |
Version: 1.0 | |
Author: Bronson Quick | |
Author URI: http://www.sennza.com.au | |
License: GPL2 |
NewerOlder