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 | |
$included_files = get_included_files(); | |
foreach ($included_files as $filename) { | |
if( strpos( $filename, 'file_name') !== false ){ //Check if filename | |
echo $filename.'<br>'; | |
} | |
} |
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 | |
if( is_wc_endpoint_url( 'order-received' ) ){ | |
//To check if thank you page | |
} | |
if(is_checkout()){ | |
// Check if in checkout page | |
} |
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
Outlook Conditionall rules | |
<!--[if gte mso 9]> | |
<style type="text/css"> | |
/* Your Outlook-specific CSS goes here. */ | |
</style> | |
<![endif]--> | |
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 | |
$settings = array( | |
'textarea_name' => 'c_name', | |
'quicktags' => array( 'buttons' => 'em,strong,link' ), | |
'tinymce' => array( | |
'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator', | |
'theme_advanced_buttons2' => '', | |
), | |
'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>', | |
); |
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 | |
// Get all posts of a custom post type and list a specific meta value from the posts | |
public function section_above_applicant_listings(){ | |
global $wpdb; | |
$key = 'thjmf_applicant_job_relation'; | |
$post_type = 'thjmf_applicants'; | |
$query = " | |
SELECT DISTINCT($wpdb->postmeta.meta_value) |
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 for user capability check | |
function is_user_capable(){ | |
$capable = false; | |
$user = wp_get_current_user(); | |
$allowed_roles = array('editor', 'administrator'); | |
if( array_intersect($allowed_roles, $user->roles ) ) { | |
$capable = true; | |
} |
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
If wrapper has flex applied and children is in the following structure | |
col1 col2 col3 | |
And you want to break col3 to a new line, then apply flex-wrap:wrap to the wrapper and flex-basis:100% to the child who | |
should igonre the parent flex style (Here col3). | |
If still the childs are arranged as rows, then add width to other childs except which should ignore the flex style ( Here Col1 and Col 2) |
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 | |
// Code to find the type of email send | |
// if $email variable is available, then use, | |
if ( $email->id == 'cancelled_order' ) {} | |
if ( $email->id == 'customer_completed_order' ) {} | |
if ( $email->id == 'customer_invoice' ) {} | |
if ( $email->id == 'customer_new_account' ) {} | |
if ( $email->id == 'customer_note' ) {} | |
if ( $email->id == 'customer_on_hold_order' ) {} |
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 : Skip wepo options for WPC WooCommerce Bundle plugin | |
Plugin : Extra product options (Themehigh), WPC Product Bundle | |
*/ | |
function unset_file_upload_for_child_products( $skip, $cart_item_data, $product_id, $variation_id ){ | |
if( isset( $cart_item_data['woosb_parent_id']) ){ | |
return true; | |
} | |
return $skip; |
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 | |
// Functionality : Add usermeta fields to exported csv when exporting customers using WooCommerce Customer/Order/Coupon Export | |
plugin (Skyverge) | |
add_filter( 'wc_customer_order_csv_export_customer_headers', 'melvin_order_csv_export_customer_headers', 10, 2 ); | |
add_filter( 'wc_customer_order_csv_export_customer_row', 'melvin_order_csv_export_customer_row', 10, 4 ); | |
function setup_checkout_usermeta_fields(){ | |
// Replace the below array with checkout field names that is set as usermeta |