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
{ | |
"name": "demo/demo", | |
"description": "Demo plugin", | |
"type": "wordpress-plugin", | |
"require": { | |
"composer/installers": "v1.0.6" | |
}, | |
"authors": [ | |
{ | |
"name": "iValue", |
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 // only copy this line if needed | |
/** | |
* Function adds a BCC header to emails that match our array | |
* | |
* @param string $headers The default headers being used | |
* @param string $object The email type/object that is being processed | |
*/ | |
function add_bcc_to_certain_emails( $headers, $object ) { |
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 | |
// in your functions.php | |
function admin_bar(){ | |
if(is_user_logged_in()){ | |
add_filter( 'show_admin_bar', '__return_true' , 1000 ); | |
} | |
} | |
add_action('init', 'admin_bar' ); |
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
<?pp | |
/* | |
!!! Just a quick warning, if WooCommerce updates its plugin these changes will be gone !!! | |
1) Find class-wc-eu-vat-number.php, it's located under wp-contents/plugins/woocommerce-eu-vat-number/includes | |
2) Skim trough until you find line 160 | |
3) Do the following | |
*/ |
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
// Checking if we are editting in the Mautic Builder. | |
if( $('.builder-active', window.parent.document).length ) { | |
// Do stuff here | |
} |
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 send_sms_order_not_complete($orderid){ | |
// Our order | |
$order = new WC_Order($orderid); | |
// When after 10min our order hasn't got the completed status... | |
if( $order->get_status() != 'completed' ){ | |
// We send out a message through either a notification or SMS api. | |
} |
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 catch_new_order($orderid){ | |
// Check for new order | |
// Set a scheduled event after 10min to check if order has been succesfully proccesed. | |
// If not, send SMS with orderID and name of client. | |
// 1: We are setting the time of the event after 10 minutes. | |
// 2: We provide an action to be called if the event is run. | |
// 3: We provide additional parameters to got with the action. In this case our order id. |
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
function global_discount(){ | |
global $woocommerce; | |
$coupon = 'your-coupon-code-name'; | |
// We'll add the coupon code the first time. | |
// This way users can remove the coupon code | |
// when they have a bigger discount coupon. | |
if( 0 == $woocommerce->cart->cart_contents_count ){ | |
// This coupon can be managed from the coupon dashboard |
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 | |
/* Capture CF7 data */ | |
add_action( 'wpcf7_mail_sent', 'wpcf7_capture_data' ); | |
function wpcf7_capture_data( $contact_form ) { | |
$submission = WPCF7_Submission::get_instance(); | |
if ( $submission ) { | |
$posted_data = $submission->get_posted_data(); |
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 | |
$args = array( | |
'post_author' => 1, | |
'post_content' => '', | |
'post_status' => "draft", // (Draft | Pending | Publish) | |
'post_title' => '', | |
'post_parent' => '', | |
'post_type' => "product" | |
); |
NewerOlder