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; | |
} |
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: Add delivery date to export | |
* Plugin URI: | |
* Description: | |
* Version: 1.0 | |
* Author: | |
* Author URI: | |
**/ |
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 | |
// for troubleshooting specific site. | |
add_action( 'wp', 'get_subs_by_products' ); | |
function get_subs_by_products() { | |
$product_ids = array(39002, 39001, 27181, 26017, 73821, 4178); | |
$subscriptions = wcs_get_subscriptions( array( 'product_id' => $product_ids, 'subscriptions_per_page' => -1, 'subscription_status' => array( 'wc-active', 'wc-on-hold' ) ) ); | |
$number_of_subs = count($subscriptions); |