ssh -i ~/.ssh/your_private_key' <git command>
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 Role extends Model | |
| { | |
| const ROLE_ADMIN_ID = 1; | |
| protected $casts = [ | |
| 'permissions' => 'array', | |
| ]; |
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 delete_flamingo_spam() | |
| { | |
| // no. of records to delete each call | |
| $num_records = 25; | |
| $args = array( | |
| 'post_type'=> array( | |
| 'flamingo_inbound', |
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_action( 'woocommerce_product_query', 'show_onsale_products' ); | |
| function show_onsale_products( $q ){ | |
| if ( isset($_GET['on_sale']) ) { | |
| $product_ids_on_sale = wc_get_product_ids_on_sale(); | |
| $q->set( 'post__in', $product_ids_on_sale ); | |
| } | |
| } |
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
| // WY HOMEPAGE RE-DESIGN | |
| $card-height: 400px; | |
| $logo-height: 24px; | |
| .sticky-logo { | |
| max-height: $logo-height !important; | |
| } | |
| .sticky_header .top-headers-wrapper { |
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 | |
| // options | |
| // array( | |
| // 'rtl' => is_rtl(), | |
| // 'animation' => 'slide', | |
| // 'smoothHeight' => true, | |
| // 'directionNav' => false, | |
| // 'controlNav' => 'thumbnails', // can be boolean | |
| // 'slideshow' => false, | |
| // 'animationSpeed' => 500, |
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 action_woocommerce_before_shop_loop_item_title() { | |
| $product = wc_get_product(); | |
| $coupon = new WC_Coupon('BF50'); | |
| if ( $coupon->is_valid_for_product( $product ) ) { | |
| echo '<div class="onsale">Sale!</div>'; | |
| } |
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_action( 'template_redirect', 'change_default_payment_gateway' ); | |
| function change_default_payment_gateway(){ | |
| if( is_checkout() && ! is_wc_endpoint_url() ) { | |
| $default_payment_id = 'paytabs_applepay'; | |
| WC()->session->set( 'chosen_payment_method', $default_payment_id ); | |
| } |
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 | |
| // Here a sample using the Paytabs Apple Pay gateway, any of the 2 filter below will work. | |
| // Use this to add additional attribute to the image | |
| add_filter( 'woocommerce_gateway_icon', 'apple_paytabs_gateway_icon', 10, 2 ); | |
| function apple_paytabs_gateway_icon( $icon, $id ) { | |
| if ( $id === 'paytabs_applepay' ) { | |
| return '<img src="' . get_stylesheet_directory_uri() . '/assets/applepay.svg' . '" style="height: 21px; margin-bottom: 0 !important;" > '; |
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_filter('manage_{post_type}_posts_columns', 'posts_columns_id'); | |
| add_action('manage_{post_type}_posts_custom_column', 'posts_custom_id_columns', 10, 2); | |
| function posts_columns_id($defaults){ | |
| $defaults['wp_post_id'] = __('ID'); | |
| return $defaults; | |
| } |
NewerOlder