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 | |
#################### | |
## VARS ## | |
#################### | |
# set this as your github username | |
username=stirtingale | |
password=qwerty | |
# automatically get existing git name | |
function get_git_name() { | |
git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p' |
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: WooCommerce Custom Product Type | |
* Plugin URI: http://jeroensormani.com | |
* Description: A simple demo plugin on how to add a custom product type. | |
*/ | |
/** | |
* Register the custom product type after init | |
*/ |
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 if ( current_user_can('administrator') ): ?> | |
<script> | |
function custom_field(key, value) { | |
this.key = key; | |
this.value = value; | |
} | |
<?php $getPostCustom=get_post_custom(); // Get all the data ?> | |
var cf = {}; | |
<?php foreach($getPostCustom as $name=>$value): ?> | |
// an object whose properties are objects |
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 | |
/* ======================================================================================================================== | |
ACF Options | |
======================================================================================================================== */ | |
// if( function_exists('acf_add_options_page') ) { | |
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
// based on ggwarpig stackoverflow anwser to | |
// "Where do I find the Instagram media ID of a image" | |
// @ https://stackoverflow.com/a/37246231 | |
function instagram_id_to_url($instagram_id){ | |
$url_prefix = "https://www.instagram.com/p/"; | |
if(!empty(strpos($instagram_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
#!/bin/bash | |
now="$(date +'%d')" | |
# command to backup scripts goes here | |
WPDBNAME=`cat public_html/wp-config.php | grep DB_NAME | cut -d \' -f 4` | |
WPDBUSER=`cat public_html/wp-config.php | grep DB_USER | cut -d \' -f 4` | |
WPDBPASS=`cat public_html/wp-config.php | grep DB_PASSWORD | cut -d \' -f 4` | |
mysqldump -u $WPDBUSER -p$WPDBPASS $WPDBNAME | gzip> db_backups/"$now"_backup.sql.gz |
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 | |
/* | |
Template Name: wbz404 > CSV output | |
*/ | |
?> | |
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> | |
<p>source URL, target URL</p> | |
<?php | |
global $wpdb; | |
$redirects = 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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<remove name="Vary"></remove> | |
<add name="Vary" value="Accept-Encoding"></add> | |
</customHeaders> | |
</httpProtocol> | |
<staticContent> |
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
development: | |
store: example.myshopify.com | |
password: add-password-in-config | |
theme_id: "live" | |
bucket_size: 40 | |
refill_rate: 2 | |
ignore_files: | |
- "*.swp" | |
- "*~" | |
- "config/settings_data.json" |
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 | |
// vars | |
$post_id = get_the_id(); | |
$images = get_field('gallery'); | |
$caption = get_field('caption'); | |
$content = get_the_content(); | |
// var_dump($post_id); |
OlderNewer