- Login to your HubStaff account.
- Go to https://developer.hubstaff.com/my_apps.
- Create an app.
- Save the app ID.
- Follow the directions for obtaining your auth token.
- You can use the API portal to get your auth token: https://developer.hubstaff.com/docs/api#!/auth/postV1Auth.
- Save the auth token.
- Install the shortcut: https://www.icloud.com/shortcuts/a0489014fbda493bb933b07d7a31bfb3.
- Edit the shortcut, adding your
App-Token
andAuth-Token
in the indicated Text boxes.
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
SELECT | |
p.`post_type`, | |
COUNT( pm.`post_id` ) as postmeta_count | |
FROM `wp_posts` as p | |
JOIN `wp_postmeta` as pm | |
ON (p.`ID` = pm.`post_id`) | |
GROUP BY p.`post_type` | |
ORDER BY | |
postmeta_count DESC, | |
p.`post_type` ASC |
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
.screen-reader-text { | |
clip: rect(1px, 1px, 1px, 1px); | |
clip-path: polygon(0px 0px, 0px 0px,0px 0px, 0px 0px); | |
position: absolute !important; | |
white-space: nowrap; | |
height: 1px; | |
width: 1px; | |
overflow: hidden; | |
} |
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 posts_clauses( $clauses, $wp_query ) { | |
/* reference: https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/ */ | |
if ( !$wp_query->is_search() ) | |
return $clauses; | |
global $wpdb; | |
$clauses['join'] .= | |
' LEFT JOIN ' . $wpdb->postmeta . |
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 | |
/** | |
* Functionality to mark a dev install as dirtied (compared to production). | |
* | |
* @link https://gist.github.com/crstauf/70c983893cf88ed51d887cec4672e3af GitHub. | |
*/ | |
if ( !defined( 'ABSPATH' ) || !function_exists( 'add_filter' ) ) { | |
header( 'Status: 403 Forbidden' ); | |
header( 'HTTP/1.1 403 Forbidden' ); |
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( 'woocommerce_webhook_delivery', function( $args, $response, $duration, $arg, $webhook_id ) { | |
$order = wc_get_order( $arg ); | |
if ( | |
empty( $order ) | |
|| is_wp_error( $order ) | |
|| !is_a( $order, 'WC_Order' ) | |
) | |
return; |
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: Development Environment Preventions | |
* Description: MU-plugin to prevent production functionality on development sites. | |
* Plugin URI: https://gist.github.com/crstauf/793d8d70dd6d2572e698f8b46ab6316b | |
* Author: Caleb Stauffer | |
* Author URI: https://develop.calebstauffer.com | |
*/ | |
$production_site_url = '{PRODUCTION SITE URL}'; |
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 | |
/** | |
* Description: MU-Plugin of CLI command to purge WooCommerce data. | |
* Plugin URI: https://gist.github.com/crstauf/0917df51455efa1a61058c050565fe72 | |
* Author: Caleb Stauffer | |
* Author URI: https://develop.calebstauffer.com | |
*/ | |
if ( !defined( 'WP_CLI' ) || !WP_CLI ) | |
return; |
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
SELECT `option_name`, `option_value` FROM `wp_options` WHERE `option_name` LIKE '\_transient\_timeout\_%' AND CAST(`option_value` AS UNSIGNED) < UNIX_TIMESTAMP() ORDER BY `option_value`; |
- Login to your Harvest account.
- Go to https://id.getharvest.com/developers.
- Create a new Personal Access Token.
- Save the account ID and access token.
- Install the shortcut: https://www.icloud.com/shortcuts/b6baff60b2c245379a6af5545ae9c5ac.
- Edit the shortcut, adding your
Access_Token
andAccount_ID
in the indicated Text boxes. - Save the shortcut.
- Done!