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: Test Plugin | |
* Author: Joshua Flowers | |
* Version: 0.1.0 | |
*/ | |
function test_plugin_modify_product_template() { | |
$template_registry = Automattic\WooCommerce\Admin\Features\ProductBlockEditor\ProductTemplates\ProductTemplateRegistry::get_instance(); | |
$simple_template = $template_registry->get_registered( 'simple' ); |
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: Disable WooCommerce Admin | |
* Description: This plugin disables the new WooCommerce Admin package in WooCommerce. | |
* Version: 1.0 | |
*/ | |
add_filter( 'woocommerce_admin_disabled', '__return_true' ); |
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
require 'rspec' | |
# Utils for flattening an array recursively | |
# Usage: ArrayUtils.new(array_to_flatten).flatten | |
class ArrayUtils | |
def initialize(array) | |
raise 'Must be initialized with an array' unless array.kind_of? Array | |
@array = array | |
end |