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
add_action( 'admin_post_nopriv_update_cart', 'scichart_update_cart' ); | |
add_action( 'admin_post_update_cart', 'scichart_update_cart' ); | |
function scichart_update_cart() { | |
defined( 'WC_ABSPATH' ) || exit; | |
/** | |
* Load woo dependencies | |
* Normally, they are only loaded on the fronted |
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 | |
/** | |
* Utility class to extend tiny mce | |
*/ | |
class EchoTinyMCE { | |
public function __construct() { | |
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
// Get Order ID and Key | |
$order->get_id(); | |
$order->get_order_key(); | |
// Get Order Totals | |
$order->get_formatted_order_total(); | |
$order->get_cart_tax(); | |
$order->get_currency(); | |
$order->get_discount_tax(); | |
$order->get_discount_to_display(); |
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 | |
/** | |
* Template usage | |
* --- ACF --- | |
* $data = get_sbi_instagram_feed( get_field("feed_id") ); | |
* --- Manual --- | |
* $data = get_sbi_instagram_feed( 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
<?php | |
header("Content-type: application/json"); | |
$now = new DateTime(); | |
$cleaned = $purged = $saved = 0; | |
$files = glob("./file/directory/that/holds/items/*.{jpg,png,gif,JPG,jpeg}", GLOB_BRACE); | |
for ($i = 0; $i < count($files); $i++){ | |
$date = date('Y-m-d h:i:s', filemtime($files[$i])); |
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
$.fn.isInViewport = function() { | |
var elementTop = $(this).offset().top; | |
var elementBottom = elementTop + $(this).outerHeight(); | |
var viewportTop = $(window).scrollTop(); | |
var viewportBottom = viewportTop + $(window).height(); | |
return elementBottom > viewportTop && elementTop < viewportBottom; | |
}; |
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
$.fn.toggleText = function() { | |
var altText = this.data("alt-text"); | |
if (altText) { | |
this.data("alt-text", this.html()); | |
this.html(altText); | |
} | |
}; |
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 | |
class DBHandler { | |
private $host = "hostname"; | |
private $user = "database_user"; | |
private $password = "database_password"; | |
private $database = "database_name"; | |
private $conn; |
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 | |
/** | |
* Basic Session Helper Class | |
* | |
* A simple helper class for handling session consistently | |
* | |
* Usage Example: | |
* <?php | |
* require 'path/to/util.session.php'; |
NewerOlder