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 | |
| /** | |
| * Unhook default EDD discount field | |
| */ | |
| remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 ); | |
| /** | |
| * Add our own callback for the discount field, keeping the same CSS as before | |
| */ |
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
| # GET number of orders | |
| select count(*)from wp_posts where post_type = 'shop_order'; | |
| # DELETE ORDERS | |
| delete from wp_postmeta where post_id in ( | |
| select ID from wp_posts where post_type = 'shop_order'); | |
| delete from wp_posts where post_type = 'shop_order'; | |
| # DELETE order refunds |
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
| # GET number of orders | |
| select count(*)from wp_posts where post_type = 'shop_order'; | |
| # DELETE ORDERS | |
| delete from wp_postmeta where post_id in ( | |
| select ID from wp_posts where post_type = 'shop_order'); | |
| delete from wp_posts where post_type = 'shop_order'; | |
| # DELETE order refunds |
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
| // call it in your theme or plugin function file. | |
| wp_frm_populate_user_dropdown( 485, 'subscriber' ); // you can change field_id & role as per your need. | |
| function wp_frm_populate_user_dropdown($field_id, $role = 'subscriber') { | |
| $user_info = array ( 'field_id' => $field_id, 'role' => $role ); | |
| add_filter('frm_setup_new_fields_vars', function ( $values, $field ) use ($user_info) { | |
| $values = frm_populate_user_dropdown($values, $field, $user_info); | |
| return $values; |
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
| [program:laravel-worker] | |
| process_name=%(program_name)s_%(process_num)02d | |
| command=php /home/forge/app.com/artisan queue:work sqs --sleep=3 --tries=3 | |
| autostart=true | |
| autorestart=true | |
| user=forge | |
| numprocs=8 | |
| redirect_stderr=true | |
| stdout_logfile=/home/forge/app.com/worker.log |
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 | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| use PhpAmqpLib\Connection\AMQPStreamConnection; | |
| $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); | |
| $channel = $connection->channel(); | |
| $channel->queue_declare('hello', false, false, false, 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 | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| use PhpAmqpLib\Connection\AMQPStreamConnection; | |
| use PhpAmqpLib\Message\AMQPMessage; | |
| $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); | |
| $channel = $connection->channel(); | |
| $channel->queue_declare('hello', false, false, false, 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 // 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 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 | |
| /** | |
| * Custom Loop Add to Cart. | |
| * | |
| * Template with quantity and ajax. | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
| global $product; |
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 | |
| // hide coupon field on cart page | |
| function hide_coupon_field_on_cart( $enabled ) { | |
| if ( is_cart() ) { | |
| $enabled = false; | |
| } | |
| return $enabled; |