View add_magazin_link_to_breadcrumbs.php
View fix-embed-shortcode.php
<?php
// Hack due https://core.trac.wordpress.org/ticket/23431 issue
$embed = new WP_Embed();
$content = $embed->run_shortcode( $wp_query->queried_object->description );
echo '<div class="category-description">' . do_shortcode( $content ) . '</div>';
View functions.php
/**
* Remove products breadcrumb
*
* @param object $breadcrumb_obj Breadcrumb object.
*/
function my_bcn_after_fill( $breadcrumb_obj ) {
if ( is_category() || is_tag() || is_tax() ) {
foreach ( $breadcrumb_obj->breadcrumbs as $key => $item ) {
if ( 'Products' === $item->get_title() ) {
unset( $breadcrumb_obj->breadcrumbs[ $key ] );
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>