This file contains hidden or 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: Plugin Autoupdate Filter | |
Plugin URI: https://gist.github.com/NickGreen/a66d349575cf9e78c6dafd92efa5288a/edit | |
Description: Plugin which sets plugin autoupdates to always on, but only happen during specific times. | |
Version: 1.0 | |
Author: Nick Green | |
Author URI: | |
License: GPLv3 | |
*/ |
This file contains hidden or 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 | |
# Export a database backup beforehand | |
wp-cli db export --path=/htdocs/__wp__ | |
# Get a list of tables missing primary kkeys | |
TABLES=$(wp-cli --path=/htdocs/__wp__ db query 'SELECT TABLES.TABLE_NAME FROM INFORMATION_SCHEMA.TABLES LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS c ON ( TABLES.TABLE_NAME = c.TABLE_NAME AND c.CONSTRAINT_SCHEMA = TABLES.TABLE_SCHEMA AND c.constraint_name = "PRIMARY" ) WHERE c.constraint_name IS NULL AND TABLE_TYPE = "BASE TABLE"') | |
This file contains hidden or 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 | |
/* filter gallery output*/ | |
add_filter( 'shortcode_atts_gallery', 'my_shortcode_atts_gallery', 10, 4 ); | |
function my_shortcode_atts_gallery( $out, $pairs, $atts, $shortcode ) { | |
if ( ! isset( $atts['columns'] ) ) { | |
$out['columns'] = 1; | |
} | |
if ( ! isset( $atts['size'] ) ) { | |
$out['size'] = 'full'; |
This file contains hidden or 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
on: pull_request | |
name: Code tests | |
jobs: | |
runPHPCSInspection: | |
name: Run PHPCS inspection | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} |
This file contains hidden or 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"?> | |
<!--This entire file can be optionally deleted if this issue is fixed: https://github.com/rtCamp/action-phpcs-code-review/issues/35 --> | |
<ruleset name=""> | |
<description>PHPCS declaration for A8CTeam51</description> | |
<rule ref="WordPress-Extra"> | |
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | |
<exclude name="WordPress.Files.FileName.InvalidClassFileName" /> | |
</rule> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
background:black; | |
} | |
#favorites_container { | |
width:89%; | |
display:inline-block; |
This file contains hidden or 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 | |
/** | |
* Add custom headers to the list of default headers exported in the CSV | |
* | |
* @param array $headers | |
* @return array | |
*/ | |
function my_custom_export_headers( $headers = array() ) { | |
return array_merge( $headers, array( | |
'_recipient_user' => 'Recipient', |
This file contains hidden or 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 // dont copy this line | |
add_filter( 'storefront_best_selling_products_shortcode_args', 'custom_storefront_best_selling_products'); | |
function custom_storefront_best_selling_products( $args ) { | |
$args['category'] = 'installation'; | |
$args['cat_operator'] = 'NOT IN'; | |
return $args; | |
} |
This file contains hidden or 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 // don't copy this line | |
add_filter( 'woocommerce_cart_totals_coupon_html', 'custom_cart_totals_coupon_html', 30, 3 ); | |
function custom_cart_totals_coupon_html( $coupon_html, $coupon, $discount_amount_html ) { | |
$discount_amount_html = '<span>Redeemed</span>'; | |
$coupon_html = $discount_amount_html . ' <a href="' . esc_url( add_query_arg( 'remove_coupon', urlencode( $coupon->get_code() ), defined( 'WOOCOMMERCE_CHECKOUT' ) ? wc_get_checkout_url() : wc_get_cart_url() ) ) . '" class="woocommerce-remove-coupon" data-coupon="' . esc_attr( $coupon->get_code() ) . '">' . __( '[Remove]', 'woocommerce' ) . '</a>'; | |
return $coupon_html; | |
} |