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 urlExists(url, text ){ | |
jQuery.get(url, function (response, status, xhr) { | |
if (xhr.getResponseHeader("content-type").indexOf("text") > -1){ | |
//console.log( text + ' --> ' + url+ ' --> NOT PDF' ); | |
} else { | |
//console.log(xhr.getResponseHeader("content-type")); | |
if( xhr.getResponseHeader("Content-Length") == null){ | |
console.log(xhr.getResponseHeader("Content-Length")); | |
console.log( text + ' --> ' + url+ ' --> IS PDF' ); |
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
POSTIDLIST=($(wp post list --post_type=booking --format=ids)); | |
for POSTID in ${POSTIDLIST[@]}; do | |
wp post meta set $POSTID _field_name field_value | |
done |
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 post generate --format=ids --post_type=listing --count=100 | sed -e "s/ /\n/g" | xargs -n1 -I % sh -c 'echo "Adding fields for %"; wp post meta add % _address "531 east 2";wp post meta add % _country "United States"; wp post meta add % _zip "10000"; wp post meta add % _state "NY";wp post meta add % _house 35'; |
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 | |
function mml_output_setting_row( $class, $name, $value , $option_key , $data_div, $text ){ ?> | |
<p> <input type="checkbox" class="<?php echo $class ?>" name="powerpack-plugin-options[<?php echo $name ?>]" value="<?php echo $value ?>" <?php isset( $options['ecom-function'] ) ? checked($options['ecom-function'], 1) : '';?> data-div="<?php echo $data_div ?>"/><?php echo $text ?></p> | |
<?php } |
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
methods : { | |
async setOtherBookings() { | |
this.loadingOtherBookings = true; | |
if (this.booking.other_bookings.length > 0) { | |
for (let booking_post_id of this.booking.other_bookings) { | |
await this.loadOtherBooking(booking_post_id).then(response => { | |
this.addToSummary(response.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
wp scaffold child-theme twentynineteen-child --parent_theme=twentynineteen | |
wp theme activate twentynineteen-child |
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 | |
for post in $(wp post list --field=ID --allow-root) | |
do | |
count=$(wp post term list $post 'category' --fields='name' --format="count" --allow-root) | |
if [ "$count" -gt "1" ] | |
then | |
wp post term remove $post category 'uncategorized' --allow-root | |
fi | |
done |
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 | |
function create_terms( ){ | |
array=("$@") | |
for tax; do true; done | |
for term in "${array[@]}" | |
do | |
wp term create $tax "$term" --allow-root | |
done |
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 will error and break code | |
$datetime = new DateTime( 1565301395 ); | |
var_dump( $datetime ); | |
// This will work | |
$datetime = new DateTime(); | |
$datetime->setTimestamp(1565301395); | |
var_dump( $start_date ); |
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
const webpack = require("webpack"); | |
//const path = require("path"); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
module.exports = { | |
transpileDependencies: ["vuetify"], | |
outputDir: "../assets/", | |
configureWebpack: { | |
plugins: [ | |
new MiniCssExtractPlugin({ |