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 | |
function apcom_order_status_is_editable( $editable, $order ) { | |
// Editable order statuses: | |
$editable_order_status = array( 'pending', 'on-hold', 'auto-draft', 'processing' ); | |
if( in_array($order->get_status(), $editable_order_status ) ){ | |
return true; | |
} | |
return false; |
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 | |
/** | |
* This function adds custom renewal intervals for WooCommerce Subscription Products. | |
* The code as it is adds `every 8th` and `every 10th` custom frequency for Subscription renewals. | |
* To include more frequencies, add a comma separated value within the bracket. | |
* Eg, if you need an `every 9th` frequency here's how you'd update line#10 : $custom_frequency = array( 8, 9, 10 ); | |
*/ | |
function wcs_custom_frequency( $intervals ) { | |
$custom_frequency = array( 8, 10 ); |
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: WCS Enable Staging mode | |
* Description: This will set Subscriptions to Manual renewal and disable Subscription emails. | |
* Version: 1.0 | |
* Author: AashikP | |
* Author URI: https://aashikp.com | |
* Text Domain: wcs-enable-staging-mode | |
* Requires at least: 5.0 | |
* Requires PHP: 7.4 |
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
CREATE TABLE `wp_wc_admin_notes` ( | |
`note_id` bigint(20) UNSIGNED NOT NULL, | |
`name` varchar(255) NOT NULL, | |
`type` varchar(20) NOT NULL, | |
`locale` varchar(20) NOT NULL, | |
`title` longtext NOT NULL, | |
`content` longtext NOT NULL, | |
`icon` varchar(200) NOT NULL DEFAULT 'info', | |
`content_data` longtext DEFAULT NULL, | |
`status` varchar(200) NOT NULL, |
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 | |
/** | |
* Function to var_dump contents as WordPress Dashboard notification. | |
* | |
* Instructions: | |
* Optional argument $file can be supplied as __FILE__ $line supplied as __LINE__ if you also want to | |
* print out the file and line number (for whatever reason) where this function is called. | |
* | |
* @param variable $dump_this Will dump the variable as an admin notice. |
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 | |
/** | |
* Simple script that connects to Square Locations API via cURL and returns existing locations on your account. | |
* This is helpful when Square extension does not retrive the locations, and webhosts claim that cURL is working as expected | |
* Source: https://developer.squareup.com/docs/locations-api | |
* | |
* USAGE: | |
* This is not a WordPress plugin, so please upload this script to the root directory of the site | |
* and access it directly: https://example.com/square-list-locations.php | |
* |
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 | |
echo 'This is a test gist'; |