You will need JQ to format the output.
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 | |
protected function getOptions(): array | RawJs | null | |
{ | |
return [ | |
'scales' => [ | |
'x' => ['display' => false,], | |
'y' => ['display' => false,], | |
], | |
]; |
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_filter( 'wc_shipping_simulator_package_data', function( $package ){ | |
if( $product_id = $_GET['product'] ?? $_POST['product_id'] ?? false ){ | |
$package['seller_id'] = get_post_field( 'post_author', $product_id ); | |
} | |
return $package; |
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 | |
Route::match( | |
['get', 'post'], | |
'{controller}/{action?}/{params?}', | |
function ($controller, $action = 'index', $params = '') { | |
$params = explode('/', $params); | |
$methodParams = []; | |
foreach ($params as $key => $param) { |
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 | |
/** | |
* Pagar.me API | |
* | |
* @package WooCommerce_Pagarme/API | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} |
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 | |
if( !class_exists( 'WCPagarmePixPayment\Pagarme\PagarmeApiV4' ) ){ | |
return; | |
} | |
use WCPagarmePixPayment\Pagarme\PagarmeApiV4; | |
class ArtiPagarmeApi extends PagarmeApiV4 { |
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 | |
// Valor declarado. | |
add_filter( 'woocommerce_correios_shipping_args', function( $args ){ | |
if( 24 >= $args['nVlValorDeclarado'] ){ | |
$args['nVlValorDeclarado'] = 0; | |
} | |
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 | |
add_action( 'wp_enqueue_scripts', function(){ | |
$is_pix_payment_page = function(){ | |
global $wp; | |
//Page is view order or order received? | |
if( !isset($wp->query_vars['order-received']) && !isset($wp->query_vars['view-order']) ) | |
return; |
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
# You must place it above the "# BEGIN WordPress" comment. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Just change the URL to your liking. | |
RewriteRule ^(.*)$ https://www.production-site.com/wp-content/uploads/$1 [L] | |
</IfModule> |
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 | |
function wcbr_create_lottery_numbers( $order_id ){ | |
$order = wc_get_order( $order_id ); | |
$items = $order->get_items(); | |
$lucky_product_id = 28; | |
foreach( $items as $item_id => $item ) { |
NewerOlder