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
stages: | |
- deploy | |
Deploy: | |
before_script: | |
## Install ssh-agent if not already installed, it is required by Docker. | |
## (change apt-get to yum if you use an RPM-based image) | |
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' | |
## Create the SSH directory and give it the right permissions |
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
if ( defined( 'WP_CLI' ) && WP_CLI ) { | |
class Woo_Subs_Cli extends WP_CLI_Command { | |
public function update_sub_pricing( $args ){ | |
// Quick check to make sure all the require args are available | |
if( count( $args ) != 2 && is_numeric( $args[1] ) && floor( $args[1] ) != $args[1] ){ | |
WP_CLI::line( 'Please provide 1 subscription ID and new price in this format:' ); | |
WP_CLI::line( 'woosubscriptions update_sub_pricing 1111 30' ); |
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
echo "-> Getting rid of local SQL file" | |
mkdir data | |
rm -rf data/development.sql | |
touch data/development.sql | |
echo "-> Booting Docker" | |
docker-compose up --build -d | |
echo "-> Removing vendor folder" | |
rm -rf vendor | |
echo "-> Updating composer" | |
docker-compose exec php composer update |
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
// Check that required variables exist | |
if( ( process.argv[2] == undefined ) || ( process.argv[3] == undefined ) ){ | |
console.log('Missing variables') | |
console.log('1, local path to coverage file. 2, url to target css file') | |
return; | |
} | |
(async () => { | |
var fs = require("fs"); |
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
$(".header .user__menu a[href*='/students/sign_out']").on({ | |
'click' : function(e) { | |
e.preventDefault(); | |
$.ajax({ | |
type: "POST", | |
url: "https://app.examfit.co.uk/students/sign_out", | |
crossDomain: true, | |
success: function( data, textStatus, jQxhr ){ | |
alert('hi'); | |
} |
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
function gdpr_fields( $subscription_data ) { | |
$subscription_data['marketing_permissions'][0]['marketing_permission_id'] = '45e116b06'; | |
$subscription_data['marketing_permissions'][0]['enabled'] = true; | |
$subscription_data['marketing_permissions'][1]['marketing_permission_id'] = '188d4ee19'; | |
$subscription_data['marketing_permissions'][1]['enabled'] = false; | |
$subscription_data['marketing_permissions'][2]['marketing_permission_id'] = '2af3be3ab'; | |
$subscription_data['marketing_permissions'][2]['enabled'] = true; | |
return $subscription_data; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Bootstrap</title> |
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
add_action('wp_head', 'remove_one_wpseo_og', 1); | |
function remove_one_wpseo_og() { | |
global $post; | |
if( $post->post_type == 'shorthand_story' ){ | |
remove_action( 'wpseo_head', array( $GLOBALS['wpseo_og'], 'opengraph' ), 30 ); | |
} | |
} |
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 get_header(); | |
if ( post_password_required( $post->ID ) ) { | |
echo get_the_password_form(); | |
} else { | |
while ( have_posts() ) : the_post(); | |
$meta = get_post_meta($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
$custom_post_types = array( "my_post" => "my_post"); | |
$max_archive_pages = 0; // 0 == all archive page #s | |
function post_status( $new_status, $old_status, $post ) | |
{ | |
global $custom_post_types, $max_archive_pages; | |
if ( array_key_exists( $post->post_type, $custom_post_types ) && ( $new_status === "publish" || $old_status === "publish" ) ) | |
{ |
NewerOlder