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 | |
| /** | |
| * Direct Checkout on Add-to-cart | |
| */ | |
| add_filter('add_to_cart_redirect', 'yanco_add_to_cart_redirect'); | |
| function yanco_add_to_cart_redirect() { | |
| global $woocommerce; | |
| $checkout_url = $woocommerce->cart->get_checkout_url(); | |
| return $checkout_url; | |
| } |
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 | |
| /** | |
| * Add new register fields for WooCommerce registration. | |
| */ | |
| function yanco_woocommerce_extra_register_fields() { | |
| ?> | |
| <p class="form-row form-row-first"> | |
| <label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label> |
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 yanco_scripts() { | |
| if( !is_admin() ) { | |
| $query_args = array( | |
| 'family' => 'Open+Sans:300,500,700', | |
| 'subset' => 'latin,latin-ext', | |
| wp_register_script( 'adobe-typekit', 'https://use.typekit.net/jkr3fxw.js'); |
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 yanco_add_taxonomy_filters() { | |
| global $typenow; | |
| // an array of all the taxonomyies you want to display. Use the taxonomy name or slug | |
| $taxonomies = array('alle-brands'); | |
| // must set this to the post type you want the filter(s) displayed on | |
| if( $typenow == 'product' ){ |
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 | |
| Class PLUGIN_CLASS { | |
| private $required_plugins = array( 'woocommerce' ); | |
| function have_required_plugins() { | |
| if (empty($this->required_plugins)) | |
| return true; | |
| $active_plugins = (array) get_option('active_plugins', array()); | |
| if (is_multisite()) { |
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 yanco_scripts() { | |
| if( !is_admin() ) { | |
| $query_args = array( | |
| 'family' => 'Lora:400,700,400italic,700italic|Droid+Sans:400,700', | |
| 'subset' => 'latin,latin-ext', | |
| ); | |
| wp_register_style( 'yanco-google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); |
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 get_youtube_preview_image( $url ) { | |
| $vars = array(); | |
| parse_str( parse_url( $url, PHP_URL_QUERY ), $vars ); | |
| return 'https://img.youtube.com/vi/'.$vars['v'].'/hqdefault.jpg'; | |
| } |
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 get_vimeo_video_id( $vimeo_url ) { | |
| // ----- http://stackoverflow.com/a/10489007/1291469 ----- // | |
| $video_id = (int) substr(parse_url($vimeo_url, PHP_URL_PATH), 1); | |
| return $video_id; | |
| } | |
| function get_vimeo_thumbnail( $vimeo_url ) { | |
| // ----- http://stackoverflow.com/a/1361192/1291469 ----- // |
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 get_youtube_preview_image( $url ) { | |
| $vars = array(); | |
| parse_str( parse_url( $url, PHP_URL_QUERY ), $vars ); | |
| return 'https://img.youtube.com/vi/'.$vars['v'].'/hqdefault.jpg'; | |
| } |
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
| User-agent: * | |
| Disallow: /*add-to-cart=* | |
| Disallow: /cart/ | |
| Disallow: /checkout/ | |
| Disallow: /my-account/ |