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
public function ttr_container( $content ) { | |
$custom_content = ''; | |
if(0 == 0) { | |
ob_start(); | |
$this->social_share(); | |
$custom_content .= ob_get_contents(); | |
ob_end_clean(); | |
} | |
$custom_content .= '<div class="ttr_start"></div>'; | |
$custom_content .= $content; |
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 | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ |
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 Canada Price to Woo as custom field and change per country. | |
// You can add as many as you need | |
add_action( 'woocommerce_product_options_pricing', 'add_can_price_box' ); | |
function add_can_price_box() { | |
woocommerce_wp_text_input( array( 'id' => 'can_price', 'class' => 'wc_input_price_extra_info short', 'label' => __( 'Price in Canadian $', 'woocommerce' ) ) ); | |
} | |
// This one is for saving above fields | |
add_action('woocommerce_process_product_meta', 'save_can_price', 2, 2); | |
function save_can_price($post_id, $post) { |
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
public function gens_send_email($user_id,$coupon_code) { | |
if ( !$user_id || !$coupon_code) { | |
return false; | |
} | |
global $woocommerce; | |
$mailer = $woocommerce->mailer(); | |
$user_info = get_userdata($user_id); |
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
(function(d, s, id){ | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "https://connect.facebook.net/en_US/sdk.js"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk')); | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : 'app_id', |
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 | |
/** | |
* @package AMRW | |
* @subpackage Admin functions | |
*/ | |
/** | |
* Class AMRW_Page_Template |
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
register_post_type('product', | |
array( 'labels' => array( | |
'name' => __( 'Product', 'wpgens' ), /* This is the Title of the Group */ | |
'singular_name' => __( 'Product', 'wpgens' ), /* This is the individual type */ | |
'all_items' => __( 'All Products', 'wpgens' ), /* the all items menu item */ | |
'add_new' => __( 'Add New Product', 'wpgens' ), /* The add new menu item */ | |
'add_new_item' => __( 'Add New Product', 'wpgens' ), /* Add New Display Title */ | |
'edit' => __( 'Edit', 'wpgens' ), /* Edit Dialog */ | |
'edit_item' => __( 'Edit Product', 'wpgens' ), /* Edit Display Title */ | |
'new_item' => __( 'New Product', 'wpgens' ), /* New Display Title */ |
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
/* Input type Select - kreirati neke JS funkcije za reuse | |
======================= */ | |
var selects = document.getElementsByClassName('input__field--select'); | |
[].forEach.call(selects,function(select){ | |
var docFrag = document.createDocumentFragment(), | |
mainNode = document.createElement('div'), | |
span = document.createElement('span'), | |
ul = document.createElement('ul'); |
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
{ | |
"took":3, | |
"timed_out":false, | |
"_shards":{ | |
"total":6, | |
"successful":6, | |
"failed":0 | |
}, | |
"hits":{ | |
"total":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
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path |