Skip to content

Instantly share code, notes, and snippets.

View sigaev-pro's full-sized avatar

Vadim Sigaev sigaev-pro

View GitHub Profile
@growdev
growdev / gist:8674326
Last active February 10, 2022 03:03
WooCommerce Payment Gateway actions after successful order.
<?php
// Add a note to the order. Put return code here if needed.
$order->add_order_note( __('Payment completed', 'woocommerce') );
// Mark the order as complete
$order->payment_complete();
// Empty the cart
$woocommerce->cart->empty_cart();
@rilwis
rilwis / admin-menu.php
Last active February 13, 2024 12:42
Move the admin menu for custom taxonomy in WordPress
<?php
add_action( 'admin_menu', 'prefix_move_taxonomy_menu' );
function prefix_move_taxonomy_menu() {
add_submenu_page( 'edit.php?post_type=quiz', esc_html__( 'Sections', 'mb-quiz' ), esc_html__( 'Sections', 'mb-quiz' ), 'manage_categories', 'edit-tags.php?taxonomy=question_section' );
}