Skip to content

Instantly share code, notes, and snippets.

View Crocoblock's full-sized avatar

Crocoblock Crocoblock

View GitHub Profile
@Crocoblock
Crocoblock / include-class.php
Last active July 11, 2022 13:27 — forked from MjHead/include-class.php
JetEngine. Example of custom macros registration based on Jet_Engine_Base_Macros class
<?php
/**
* Note! Always include mcros file only on 'jet-engine/register-macros' hook - before base class is not avaialable,
* after - all macros already registered and you can't insert a new one.
*/
add_action( 'jet-engine/register-macros', function() {
require_once get_theme_file_path( 'macros.php' );
new My_JE_Macros();
} );
@Crocoblock
Crocoblock / JE_Query_Filter_Options_Generator.php
Last active October 11, 2022 07:09 — forked from ihslimn/JE_Query_Filter_Options_Generator.php
Generate JetSmartFilters options from JetEngine Query
<?php
class JE_Query_Filter_Options_Generator {
public function __construct() {
add_action( 'plugins_loaded', array( $this, 'maybe_add_filters' ) );
}
public function maybe_add_filters() {
@Crocoblock
Crocoblock / Hide Listing Grid widget before filtering
Last active October 17, 2022 11:01 — forked from dislokacia/Hide Listing Grid widget before filtering
Hide Listing Grid widget before filtering
jQuery( document ).ready(function( $ ) {
$( document ).on( 'jet-filter-content-rendered', function() {
$( '.hide-listing' ).removeClass( 'hide-listing' );
});
});
@Crocoblock
Crocoblock / remove-filters-button-appearence.css
Created October 17, 2022 12:56 — forked from LesykJulia/remove-filters-button-appearence.css
Allows adjusting the Remove Filters Button from the JetSmartFilters plugin loading speed to display simultaneously with the filtered-out content.
.jet-remove-all-filters {
visibility: visible;
opacity: 1;
transition: opacity 1.3s ease-out, visibility 1.3s ease-out;
}
.jet-remove-all-filters.hide {
display: flex;
visibility: hidden;
opacity: 0;
}
<style>
.jet-filter-label:after {
content: "˅";
float: right;
margin-right: 10px;
}
.jet-filter-label.noicon:after{
content: "";
<?php
add_filter( 'jet-woo-builder/template-functions/product-add-to-cart-settings', 'wvs_pro_archive_variation_button_args', 999, 2 );
function wvs_pro_archive_variation_button_args( $args ) {
global $product;
$product = wc_get_product();
$ajax_add_to_cart_enabled = 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' );
@Crocoblock
Crocoblock / jet-woo-builder-variation-swatches-in-archive-template.php
Created October 17, 2022 14:26 — forked from UraraReika/jet-woo-builder-variation-swatches-in-archive-template.php
Add variation swatches template inside archive template price widget
<?php
add_filter( 'jet-woo-builder/template-functions/product-price', 'get_wvs_pro_archive_variation_template', 999, 1 );
function get_wvs_pro_archive_variation_template( $html ) {
$wvs_archive_variation_template = wvs_pro_archive_variation_template();
$html .= $wvs_archive_variation_template;
return '<div class="price">' . $html . '</div>';
@Crocoblock
Crocoblock / cursor-as-standard-link-on-hover.css
Last active September 26, 2023 14:36 — forked from LesykJulia/cursor-as-standard-link-on-hover.css
Changing mouse cursor as a standard link on a listing item hover
@Crocoblock
Crocoblock / image-comparison-accordion-widgets-images-loading-fix.php
Last active October 20, 2022 07:33 — forked from LesykJulia/image-comparison-accordion-widgets-images-loading-fix.php
Fix images loading when logged out in the Image Comparison and Accordion widgets
<?php
add_action( 'init', function(){
global $wp_scripts;
$script = $wp_scripts->query( 'imagesloaded', 'registered' );
if ( ! $script ) {
return;
@Crocoblock
Crocoblock / text_after_upload.js
Last active June 22, 2024 20:38 — forked from dislokacia/text_after_upload.js
JetFormbuilder media field text after upload
document.addEventListener( 'DOMContentLoaded', function() {
const {
addAction,
} = window.JetPlugins.hooks;
const textChoose = 'Choose File';
const textEmpty = 'No file has been chosen';
const textUpload = 'File Uploaded';
function getFileNames( fileList ) {