View class-pie-wcwl-waitlist-mailout.php
diff --git a/wp-content/plugins/woocommerce-waitlist/classes/class-pie-wcwl-waitlist-mailout.php b/wp-content/plugins/woocommerce-waitlist/classes/class-pie-wcwl-waitlist-mailout.php
index e77ed03..2e41933 100644
--- a/wp-content/plugins/woocommerce-waitlist/classes/class-pie-wcwl-waitlist-mailout.php
+++ b/wp-content/plugins/woocommerce-waitlist/classes/class-pie-wcwl-waitlist-mailout.php
@@ -83,6 +83,9 @@ if ( ! class_exists( 'Pie_WCWL_Waitlist_Mailout' ) ) {
public function add_user_to_archive( $product_id, $user_id ) {
$existing_archives = get_post_meta( $product_id, 'wcwl_waitlist_archive', true );
$today = strtotime( date( "Ymd" ) );
+ if (empty($existing_archives)) {
+ $existing_archives = array();
View add-woocommerce-category-to-menu.php
<?php
$args = array(
'menu-item-object-id' => $term['term_id'],
'menu-item-object' => 'product_cat',
'menu-item-parent-id' => 0,
'menu-item-type' => 'taxonomy',
'menu-item-status' => 'publish',
);
$res = wp_update_nav_menu_item( MENU_ID, 0, $args );
View wp-sentry-integration.php
<?php
/**
* Plugin Name: WordPress Sentry
* Plugin URI: https://github.com/stayallive/wp-sentry
* Description: A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.
* Version: must-use-proxy
* Author: Alex Bouma
* Author URI: https://alex.bouma.me
* License: MIT
*/
View youtube-result-titles-text.js
var parsed = [], titles = $$('h3 a');
for (i in titles) {
parsed.push((titles[i].text).trim());
}
console.log(parsed);
//copy(parsed); // Copy to clipboard
View ssh-connections.sh
#!/bin/bash
ss -tnpa |grep ESTAB |grep ssh
View clone-git-submodules
cat .gitmodules|grep url|cut -d = -f 2 | xargs -L1 git clone
View disable-LongConditionClosingCommentSniff.xml
<rule ref="Squiz">
<exclude name="Squiz.Commenting.LongConditionClosingCommentSniff"/>
</rule>
View htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_NAME} localhost
RewriteRule ^wp-content/uploads/(.+)$ http://www.example.com/wp-content/uploads/$1 [R=301,L]
</IfModule>
View woocommerce-add-to-cart
?add-to-cart=PRODUCT_ID&quantity=1&variation_id=VARIATION_ID&attribute_ATTRIBUTE_NAME=ATTRIBUTE_SLUG
View gist:e6fee1798b9118bf9bd69626501bb1b1
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {