- XAMPP for Windows: https://www.apachefriends.org/de/download.html
- Download Xdebug for:
| function custom_filter_notifications_get_registered_components( $component_names = array() ) { | |
| // Force $component_names to be an array | |
| if ( ! is_array( $component_names ) ) { | |
| $component_names = array(); | |
| } | |
| // Add 'insert_post_comment' component to registered components array | |
| array_push( $component_names, 'insert_post_comment' ); |
| C:\vagrant-local>vagrant up | |
| __ __ __ __ | |
| \ V\ V\ V / Varying Vagrant Vagrants | |
| \_/\_/\_/ v2.2.1-git::master | |
| Docs: https://varyingvagrantvagrants.org/ | |
| Contribute: https://github.com/varying-vagrant-vagrants/vvv | |
| Dashboard: http://vvv.test | |
| Bringing machine 'default' up with 'virtualbox' provider... |
| <?php | |
| function convert_time_one_timezone_to_other_timezone( $current_timezone = '', $time = '', $convert_to_timezone = 'EST' ) { | |
| $utc_date = DateTime::createFromFormat( | |
| 'G:i', | |
| "$time", | |
| new DateTimeZone("$current_timezone") | |
| ); |
| <?php | |
| function cs_wcmenucart($menu, $args) { | |
| global $woocommerce; | |
| $viewing_cart = __('View your shopping cart', 'your-theme-slug'); | |
| $start_shopping = __('Start shopping', 'your-theme-slug'); | |
| $cart_url = $woocommerce->cart->get_cart_url(); | |
| $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); | |
| $cart_contents_count = $woocommerce->cart->cart_contents_count; |
| <?php | |
| add_action( 'after_setup_theme', 'cs_remove_woo_gallery_lightbox', 100 ); | |
| function cs_remove_woo_gallery_lightbox() { | |
| remove_theme_support( 'wc-product-gallery-lightbox' ); | |
| } |
| <?php | |
| add_filter('woocommerce_get_order_item_totals','cs_add_discount',10,3); | |
| function cs_add_discount($total_rows, $order, $tax_display) { | |
| if ( $order->get_total_discount() > 0 ) { | |
| $coupons = $order->get_used_coupons(); | |
| $total_rows['couponused'] = array( | |
| 'label' => __( 'Coupon code:', 'woocommerce' ), | |
| 'value' => '' . implode(",",$coupons), ); | |
| } |
| <?php | |
| function set_featured_image($url,$post_id) { | |
| $attachment_id = media_sideload_image( $url, $post_id, '', 'id' ); | |
| if ( ! is_wp_error( $attachment_id ) ) { | |
| set_post_thumbnail( $post_id, $attachment_id ); | |
| } | |
| } |
| <?php | |
| add_filter( 'login_headerurl', 'custom_loginlogo_url' ); | |
| function custom_loginlogo_url($url) { | |
| return 'http://www.wordpress.com'; | |
| } |
| <?php | |
| function custom_loginlogo() { | |
| echo '<style type="text/css">h1 a {background-image: url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } | |
| </style>'; | |
| } | |
| add_action('login_head', 'custom_loginlogo'); |