Skip to content

Instantly share code, notes, and snippets.

View banna360's full-sized avatar
🏠
Working from home

Hasanul Banna banna360

🏠
Working from home
View GitHub Profile
@banna360
banna360 / wl-api.php
Created August 27, 2020 08:35 — forked from ivandoric/wl-api.php
Creating WordPress Rest API Custom Endpoints Video Tutorial Note. - Check out the video: https://www.youtube.com/watch?v=C2twS9ArdCI
<?php
/**
* Plugin Name: Custom API
* Plugin URI: http://chrushingit.com
* Description: Crushing it!
* Version: 1.0
* Author: Art Vandelay
* Author URI: http://watch-learn.com
*/
@banna360
banna360 / gist:8e49a6f365e0ea7a00e2a1a9c8370a7e
Last active August 22, 2020 12:39
Woocommerce Price + Coupon Based Total Price Set
/// Custome Total Pirce Rule
function custom_calculated_total( $total, $cart ){
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return;
$coupons_50_price = array('sha001', 'sha002', 'sha003', 'sha004', 'sha005'); // Add add full list here
$coupons_100_price = array('sha301', 'sha302', 'sha303', 'sha304', 'sha305'); // Add add full list here
$coupons_200_price = array('sha601', 'sha602', 'sha603', 'sha604', 'sha605'); // Add add full list here
$applied_coupons = WC()->cart->get_applied_coupons();
if($applied_coupons) {
$ sudo apt-get update
$ sudo apt-get install nginx
$ sudo ufw allow 'Nginx HTTP'
$ sudo ufw status
# You should see HTTP traffic allowed in the displayed output:
Output
Status: active
<?php
// create custom plugin settings menu
add_action('admin_menu', 'my_cool_plugin_create_menu');
function my_cool_plugin_create_menu() {
//create new top-level menu
add_menu_page('Google Ad', 'Google Ad Settings', 'administrator', __FILE__, 'my_cool_plugin_settings_page' , 'dashicons-screenoptions', __FILE__) );
//call register settings function
/www/html/wp-content/plugins/eventON/includes/class-evo-widget-main.php line number 433 updated with code: $shortcode = '[add_eventon hide_past="yes" event_count="7"]'; from $shortcode = '[add_eventon hide_past="yes"]';