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 bp_notification_badge() { | |
if ( is_user_logged_in() ) { | |
echo '<ul class="noti_nav">'; | |
$notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ); | |
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
<!-- data-embed is wistia video id --> | |
<!-- extract data-thumb https://wistia.com/support/developers/extracting-thumbnails --> | |
<div class="wistia" data-embed="919q2r7d8r" data-thumb="6b08c24a857370a2a85a9b22539429340df8db0b"> | |
<div class="play-button"></div> | |
</div> |
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
var str = '31:21.92'; | |
var markS = str.match('[^.]*$'); // Find everything after '.' | |
if (markS.toString().length < 2) { // Check lenght of output | |
console.log(markS); | |
console.log(str + '0'); // When oput is less than 2 it needs an extra 0 | |
} else { | |
console.log(markS); | |
console.log('It\'s OK'); | |
} |
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
.select2-container--default .select2-selection--single { | |
border-radius: 0 !important; | |
border-color: #ccc !important; | |
background-color: #fcfcfc; | |
height: 36px !important; | |
} | |
.select2-container--default .select2-selection--single .select2-selection__rendered { | |
line-height: 36px !important; | |
} |
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 | |
/** | |
* Filter ACF Meta so repeater fields can be used in meta_query | |
* Here 'repeater_field' is the repeater field name | |
*/ | |
function cts_filter_acf_meta( $where ) { | |
$where = str_replace( "meta_key = 'repeater_field_$", "meta_key LIKE 'repeater_field_%", $where); | |
return $where; |
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 | |
/** | |
* Notify admin when a new customer account is created and user meta data is saved | |
* So, you can show user meta data like 'billing_phone' in the email | |
*/ | |
add_action( 'woocommerce_checkout_update_user_meta', 'woocommerce_created_customer_admin_notification' ); | |
function woocommerce_created_customer_admin_notification( $customer_id ) { | |
wp_send_new_user_notifications( $customer_id, 'admin' ); |
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 | |
/** | |
* ACF Conditional Required Field | |
*/ | |
function validate_property_size_field( $valid, $value, $field, $input ){ | |
// bail early if value is already invalid | |
if ( ! $valid ) { return $valid; } |