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 | |
/** | |
* Adds Page to a WordPress navmenu | |
* @param [int] $page_id The ID of the page you want to add | |
* @param [str] $page_title Title of menu item | |
* @param [int] $menu_id NavMenu ID | |
* @param [int] $parent (Optional) Menu item Parent ID | |
*/ | |
function add_page_to_menu($page_id, $page_title, $menu_id, $parent = 0){ |
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_action( 'woocommerce_customer_changed_subscription_to_cancelled', 'customer_skip_pending_cancellation' ); | |
/** | |
* Change 'pending-cancel' status directly to 'cancelled'. | |
* | |
* @param WC_Subscription $subscription | |
*/ | |
function customer_skip_pending_cancellation( $subscription ) { | |
if ( 'pending-cancel' === $subscription->get_status() ) { |
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 | |
$context = stream_context_create(array( | |
'http' => array( | |
'header' => "Authorization: Basic " . base64_encode("$username:$password") | |
) | |
)); | |
$data = file_get_contents($url, false, $context); |
NewerOlder