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
function scrollAnimated(to, duration) { | |
var start = $(window).scrollTop(), | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
function easeInOut(currentTime, startValue, change, duration) { | |
currentTime /= duration / 2; | |
if (currentTime < 1) { |
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
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |
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
(function (root, factory) { | |
if ( typeof define === 'function' && define.amd ) { | |
define([], factory(root)); | |
} else if ( typeof exports === 'object' ) { | |
module.exports = factory(root); | |
} else { | |
root.myPlugin = factory(root); | |
} | |
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) { |
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
/** | |
* @package Thz Framework | |
* @author Themezly | |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only | |
* @websites http://www.themezly.com | http://www.youjoomla.com | http://www.yjsimplegrid.com | |
*/ | |
class ThzelGetElementSettings { | |
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 | |
/** | |
* The purpose of this file is to show how a theme can have multiple textdomains | |
* and still work with a single translation file. Translation tools like the | |
* one used on WordPress.org and Poedit are going to simply scan the project for | |
* text strings, regardless of the textdomain (and for good reasons that are | |
* not relevant here). | |
* | |
* The code below works with that system. It assumes that we have a single MO | |
* file based on the theme's textdomain. So, how can two textdomains work? It |
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
// multi condition check. help from: elementor pro > price-list.php > search by(image_spacing) | |
// content style section option | |
$this->start_controls_section( | |
'wpb_ea_post_item_content_style_options', | |
[ | |
'label' => __( 'Content', 'your-plugin' ), | |
'tab' => Controls_Manager::TAB_STYLE, | |
'condition' => [ | |
'.wpb_ea_post_carousel_content_options.wpb_ea_show_excerpt! + .wpb_ea_post_carousel_content_options.wpb_ea_read_more_btn!' => '', | |
], |
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 | |
namespace ElementorControls; | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
class Elementor_Custom_Controls { | |
private static $_instance = null; |
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
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
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
Here is my public file code | |
<?php | |
/** | |
* The public-facing functionality of the plugin. | |
* | |
* @link | |
* @since 1.0.0 | |
* | |
* @package plugin_name |
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 | |
/** | |
* Loop Add to Cart -- with quantity and AJAX | |
* requires associated JavaScript file qty-add-to-cart.js | |
* | |
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/ | |
* @link https://gist.github.com/mikejolley/2793710/ | |
*/ | |
// add this file to folder "woocommerce/loop" inside theme |