This file contains 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
name: Zip and Checksum on Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
checksum: | |
runs-on: ubuntu-latest | |
steps: |
This file contains 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
name: Generate MD5 on Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
generate-md5: | |
runs-on: ubuntu-latest |
This file contains 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 | |
/** | |
* An example on adding support for uploading images with products to the cart. | |
*/ | |
add_filter( 'cocart_after_item_added_to_cart', 'upload_image_urls_with_item', 10, 2 ); | |
/** | |
* For any image URL set while adding to the cart, upload and store location of uploaded image. | |
* |
This file contains 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 | |
if ( ! function_exists( 'wc_rest_get_product_images' ) ) { | |
add_filter( 'woocommerce_rest_prepare_product_object', 'wc_rest_get_product_images', 10, 2 ); | |
/** | |
* Get the images for a product or product variation | |
* and returns all image sizes. | |
* | |
* @param WP_REST_Request $request Request object. | |
* @param WC_Product|WC_Product_Variation $product Product instance. |
This file contains 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: WooCommerce Admin | |
* Description: Initializes WooCommerce Admin only in the backend. | |
* Version: 0.0.1 | |
*/ | |
add_action( 'plugins_loaded', function() { | |
if ( is_admin() ) { | |
\Automattic\WooCommerce\Admin\Composer\Package::init(); |
This file contains 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: WooCommerce Lite | |
* Description: Removes the need to run the packages within WooCommerce making it run better for performance. | |
* Version: 0.0.1 | |
*/ | |
add_action( 'upgrader_process_complete', 'depackage_woocommerce_after_update', 10, 2 ); | |
function depackage_woocommerce_after_update( $upgrader_object, $options ) { |
This file contains 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_filter( 'cocart_cart', 'cocart_totals_html' ); | |
function cocart_totals_html( $cart ) { | |
$decimals = wc_get_price_decimals(); | |
foreach( $cart['totals'] as $total => $value ) { | |
$value = substr_replace( $value, '', intval( '-' . $decimals ) ); | |
$cart['totals'][$total] = html_entity_decode( strip_tags( wc_price( $value ) ) ); | |
} |
This file contains 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 // do not copy this line | |
/** | |
* add_new_topic_hooks will add a new webhook topic hook. | |
* @param array $topic_hooks Esxisting topic hooks. | |
*/ | |
function add_new_topic_hooks( $topic_hooks ) { | |
// Array that has the topic as resource.event with arrays of actions that call that topic. |
This file contains 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 | |
function add_custom_filters_and_actions() { | |
add_filter( 'woocommerce_webhook_topic_hooks', 'add_custom_wcs_topics', 30, 2 ); | |
add_filter( 'woocommerce_valid_webhook_events', 'add_custom_wcs_events', 20, 1 ); | |
add_filter( 'woocommerce_webhook_topics' , 'add_custom_wcs_topics_admin_menu', 20, 1 ); | |
This file contains 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 // do not copy this line | |
/** | |
* Will clear out all the specified completed scheduled actions, 5000 at a time. | |
*/ | |
function clear_woocommerce_scheduled_actions_20200609() { | |
global $wpdb; | |
$limit = 5000; | |
$actions_table = $wpdb->prefix . 'actionscheduler_actions'; | |
$logs_table = $wpdb->prefix . 'actionscheduler_logs'; |
NewerOlder