Skip to content

Instantly share code, notes, and snippets.

View rcstr's full-sized avatar
:shipit:
Engineering

Rommel Castro rcstr

:shipit:
Engineering
View GitHub Profile
@rcstr
rcstr / functions.php
Last active September 20, 2021 20:19 — forked from jessepearson/functions.php
This is a filter to disable Multi-Currency in WooCommerce Payments. (gives higher priority 💯 to function)
<?php // Do not copy this line.
// This is a filter to disable Multi-Currency in WooCommerce Payments.
add_filter(
'pre_option__wcpay_feature_customer_multi_currency',
function ( $pre_option, $option, $default ) {
return '0';
},
100,
3
@rcstr
rcstr / report.txt
Created April 28, 2021 17:56
PHP 7.0 Compatibility report
This file has been truncated, but you can view the full file.
FILE: /wordpress/wp-content/plugins/facebook-for-woocommerce/node_modules/pako/dist/pako.min.js
--------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
1 | WARNING | File appears to be minified and cannot be processed
--------------------------------------------------------------------------------------------------------------------------------
FILE: /wordpress/wp-content/plugins/facebook-for-woocommerce/node_modules/pako/dist/pako_deflate.min.js
@rcstr
rcstr / examenparcial2.cpp
Last active November 19, 2019 04:41 — forked from emShadow/examenparcial2.cpp
Examen parcial 2
#include<stdio.h>
main(){
string partidos[] = {
"01 Jan",
"07 Jan",
"14 Jun",
"01 Feb",
"07 Feb",
"14 Feb",
<?php
function cstr_add_cart_item_data( $cart_item_data, $product_id ) {
if ( isset( $_POST ) && ! empty( $product_id ) ) {
$post_data = $_POST;
} else {
return;
}
if ( empty( $cart_item_data['my_field'] ) ) {
@rcstr
rcstr / wcs_get_active_subscribers.php
Last active December 7, 2018 23:41
Get users that have an active Subscription.
<?php
$roles = wcs_get_new_user_role_names( 'default_subscriber_role' );
get_users( array(
'role__in' => array(
$roles['new']
)
) );
@rcstr
rcstr / wc-auto-add-product-to-cart.php
Last active October 15, 2018 02:20 — forked from woogists/wc-auto-add-product-to-cart.php
Automatically add product to cart on visit, if user is not subscribed.
<?php
/**
* Automatically add product to cart on visit
*/
add_action( 'template_redirect', 'add_product_to_cart' );
function add_product_to_cart() {
if ( ! is_admin() ) {
$product_id = 226; //replace with your own product id
$found = false;
@rcstr
rcstr / functions.php
Last active August 2, 2018 13:37 — forked from danielbitzer/functions.php
[AutomateWoo] Update a queued workflow run date programatically
<?php
// create date object
$date = new DateTime( '2018-07-23 06:12:04' );
// get the queued event by ID
$event = \AutomateWoo\Queued_Event_Factory::get( $event_id );
$event->set_date_due( $date );
$event->save();
@rcstr
rcstr / wp.4.7-ES.haiku.build.min.js.md
Last active November 21, 2016 17:18 — forked from ramiabraham/wp.4.7.haiku.build.min.js.md
WordPress 4.7 ES haiku
五 🍂🍂🍁

七 🍂🍂🍂🍁

五 🍂🍂🍁


@rcstr
rcstr / gist:cba95996308c837bebe75c01293d08e0
Last active January 28, 2019 05:14 — forked from GaryJones/gist:8430080
References for Why Not to Use Singleton Design Pattern
<?
function rxc_enqueue_style() {
$theme_name = wp_get_theme()->get( 'Name' );
wp_register_style( 'library-styles', get_stylesheet_directory_uri() . '/css/library.css', array(), null, 'all' );
wp_register_style( 'another-library-styles', get_stylesheet_directory_uri() . '/css/library-2.css', array(), null, 'all' );
wp_register_style( $theme_name, get_stylesheet_uri(), array( 'library-styles', 'another-library-styles' ), null, 'all' );
wp_enqueue_style( $theme_name );