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 | |
// append custom parameters to YouTube iframe to enable JS API | |
$custom_parameters = '&rel=0&enablejsapi=1'; | |
// Append custom parameters to the src attribute of the iframe | |
$modified_iframe = preg_replace('/src="(.*?)"/', 'src="$1' . $custom_parameters . '"', $video_iframe); | |
// For Vimeo video, make sure to append ?api=1 |
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 | |
$mailer = WC()->mailer(); | |
$template = '/emails/customer-admin-order-status.php'; | |
//format the email | |
$subject = 'Order Status Update'; | |
$content = wc_get_template_html( $template, array( | |
'order' => $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 | |
/** | |
* Multiple instances of same GF form on the same page | |
*/ | |
add_filter( 'gform_get_form_filter_1', 'gform_get_form_filter_handler', 10, 2 ); | |
add_filter( 'gform_confirmation_1', 'gform_get_form_filter', 10, 2 ); | |
function gform_get_form_filter_handler( $form_string, $form ){ | |
// if form has been submitted, use the submitted ID, otherwise generate a new unique ID | |
if ( isset( $_POST['gform_random_id'] ) ) { | |
$random_id = absint( $_POST['gform_random_id'] ); // Input var okay. |
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
$imagePath: "assets/images"; | |
$breakpoints: ( | |
sm: 576px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px, | |
xxl: 1400px, | |
); |
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_shortcode('read_more_less', 'read_more_less_button_handler'); | |
function read_more_less_button_handler( $attrs, $content ){ | |
$title = $attrs['title']; | |
if( !$title ) | |
$title = "Learn More"; | |
return ' | |
<div class="readmorelessbutton-container"> |
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
<!-- Change POSTER, MP4_URL, WEBM_URL and OGG_URL --> | |
<!-- Might need to add some height to main element --> | |
<div class="video-hero jquery-background-video-wrapper demo-video-wrapper"> | |
<video class="jquery-background-video" autoplay muted loop poster="POSTER"> | |
<source src="MP4_URL" type="video/mp4"> | |
<source src="WEBM_URL" type="video/webm"> | |
<source src="OGG_URL" type="video/ogg"> | |
</video> | |
<div class="video-hero--content"></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
<?php | |
// Admin -> WC -> Settings -> Advanced -> Page Setup | |
add_filter( 'woocommerce_settings_pages' , 'add_new_woocommerce_settings_pages' ); | |
function add_new_woocommerce_settings_pages( $settings ){ | |
$new_pages = array(); | |
foreach( $settings as $s ){ | |
if( $s['id'] == 'advanced_page_options' ){ | |
$new_pages[] = array( |
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 | |
// ONLY FOR TESTING | |
add_filter("gform_pre_render", "gform_skip_page"); | |
function gform_skip_page($form) { | |
if(!rgpost("is_submit_{$form['id']}") && rgget('form_page')) | |
GFFormDisplay::$submission[$form['id']]["page_number"] = rgget('form_page'); | |
return $form; | |
} |
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_filter( 'posts_search', 'm_cars_search_vin' ); | |
function m_cars_search_vin( $where ) { | |
global $pagenow, $wpdb, $wp; | |
// check if we are on the right page & performing a search & for the right post type | |
if ( 'edit.php' != $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'cars' != $wp->query_vars['post_type'] ) { | |
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
<div class="video-container"> | |
<div class="another-container"> | |
<iframe src="https://player.vimeo.com/video/VIMEO-ID?background=1" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> | |
</div> | |
</div> | |
<style> | |
.video-container{ height: 550px; overflow: hidden; } | |
.another-container{ height:0; overflow:hidden; position: relative; padding-bottom: 56.25%; /* 16:9 */ } | |
#mobile_video_container iframe{ |
NewerOlder