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 | |
############################## | |
/* | |
Conditionally show gift add-ons if user checks a box saying they would like to send the order as a gift. | |
Created by [email protected] on 13th of July 2017 | |
As default, WooCommerce simply displays ALL the add ons so makes the checkout form look very long. | |
This is useful if you want to show a checkbox on your checkout saying "Is this a gift order?" |
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 | |
/* | |
Created by: [email protected] 16/03/2014 | |
Name of script: Create WordPress Admin User | |
Description: This script will create an admin user in wordpress | |
Usage: Create a new file in the root of the hosting account and drop this code into it then execute the script through the browser. |
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 | |
/* | |
Update an ACF custom field in wordpress with all the dealer id's when a select all | |
checbox is ticked. | |
Created by [email protected] on 24th of July 2017 | |
The ACF plugin is great but its not possible to "select all" records in a multi select | |
so we need to find a way to select all records so the user does not have to select each | |
record one by one. So easiest thing to do is make an extra checkbox field called "select all", |
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 script will allow you to send a custom email from anywhere within wordpress | |
but using the woocommerce template so that your emails look the same. | |
Created by [email protected] on 27th of July 2017 | |
Put the script below into a function or anywhere you want to send a custom email | |
*/ |
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 | |
/* | |
Sometimes you need to do some kind of action to a custom post type after its saved. | |
In the case of this function my scenario is: | |
1. I have a custom post type registered called: clients | |
2. I want the url of their details page to be: /client-number-999/ (where 999 is the post_id - or client id) | |
Created by [email protected] on 16th of August 2017 |
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 | |
############################ | |
// Block a country from accessing a certain wordpress page | |
// Put this script into your functions.php | |
// Author: [email protected] | |
// Date: 21/9/2017 | |
############################ | |
//define some page id's that you want to block | |
$array_of_page_ids_to_block = 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
<?php | |
############################ | |
// Block one or more countries from accessing one or more pages on your web site | |
// Using Wordpress? Put this script into your functions.php | |
// Author: [email protected] | |
// Date: 21/9/2017 | |
// See: https://gist.github.com/craigedmonds/2c6bea241e5e2bd29ca64eab5a2c5a57 | |
############################ | |
//define some urls you wish to block |
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 complex 8 character password which meets (exceeds actually) the rackspace mail requirements. | |
Author: [email protected] ON 27/9/2017 | |
This function allows you to specify the length of the password and the specific characters to include in the password. | |
Compleletly random passwords look ugly, so this function will build the password into a random and complex, yet friendlier looking password. |
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 | |
/* | |
written by [email protected] on 19th Jan 2016 | |
This script can be placed in a folder and will display the contents of the folder based on the file extensions you define in the settings below. | |
With this function you can: | |
- define a specific list of extensions to display on the page | |
- define a H1/title tag for the page | |
- define a custom logo |
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 | |
/* | |
Block one or more countries from accessing your web site | |
Written by [email protected] on 4th of October 2017 | |
Wordpress users you can put this in the top of your functions.php file | |
to prevent visitors from certain countries. | |
*/ |
OlderNewer