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 | |
function update_controls( $elements ) { | |
$new_elements = array(); | |
foreach ( $elements as $element_index => $element ) { | |
foreach ( $element as $key => $value ) { | |
if ( $key == 'elements' && ! empty( $value ) ) { | |
$new_elements[$element_index][$key] = update_controls( $value ); |
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 | |
$value = [ | |
[ | |
'attribute_type' => 'pa_merchant', | |
'pa_merchant' => [ 305 ], | |
], | |
[ | |
'attribute_type' => 'pa_brand', | |
'pa_brand' => [ 692 ], | |
], |
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 | |
// MS Dynamic tags | |
add_action( 'elementor/dynamic_tags/register_tags', function( $dynamic_tags ) { | |
// conditional archive title (TEXT) | |
class MS_Custom_Archive_Title_Tag extends \Elementor\Core\DynamicTags\Tag { | |
public function get_name() { | |
return 'MS_Custom_Archive_Title_Tag'; | |
} | |
public function get_categories() { |
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_filter( 'woocommerce_related_products', 'exclude_oos_related_products', 10, 3 ); | |
function exclude_oos_related_products( $related_posts, $product_id, $args ){ | |
$out_of_stock_product_ids = (array) wc_get_products( array( | |
'status' => 'publish', | |
'limit' => -1, | |
'stock_status' => 'outofstock', | |
'return' => 'ids', | |
) ); | |
$exclude_ids = $out_of_stock_product_ids; |
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 | |
// SCRIPT TO AUTOHEIGHT FOR ACF WYSIWYG AND TEXTAREA EDITOR | |
// add class `autosize` to field to work | |
class ACFAutosize { | |
public function __construct() { | |
// echo javascript | |
add_action("acf/input/admin_footer", array($this, "echoJs")); | |
add_action("acf/input/admin_head", array($this, "echoCss")); | |
} | |
public function echoJs() { |
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
<script> | |
function defer(method) { | |
if (window.jQuery) { | |
method(); | |
} else { | |
setTimeout(function() { defer(method) }, 50); | |
} | |
} |
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
http://www.youtube.com/watch?v=-wtIMTCHWuI | |
http://www.youtube.com/v/-wtIMTCHWuI?version=3&autohide=1 | |
http://youtu.be/-wtIMTCHWuI | |
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3D-wtIMTCHWuI&format=json | |
http://www.youtube.com/attribution_link?a=JdfC0C9V6ZI&u=%2Fwatch%3Fv%3DEhxJLojIE_o%26feature%3Dshare |
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 | |
$data = @json_decode( get_post_meta( 21361, '_elementor_data', true ), true ); | |
if ( $data ) { | |
function stylepress_email_find( $data, $findkey ) { | |
if ( is_array( $data ) ) { | |
foreach ( $data as $d ) { | |
if ( $d && ! empty( $d['id'] ) && $d['id'] === $findkey ) { | |
return $d; | |
} | |
if ( $d && ! empty( $d['elements'] ) && is_array( $d['elements'] ) ) { |
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 AIGetElementSettings { | |
public function __construct( $postid, $widget_id, $widget_type ) { | |
$this->postid = $postid; | |
$this->widget_id = $widget_id; | |
$this->widget_type = $widget_type; | |
$this->widget = null; | |
$this->parse(); | |
} |
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
elementor.channels.editor.on('section:activated', function(sectionName, editor) { | |
var editedElement = editor.getOption('editedElementView'); | |
if ('frymo-contact-form' !== editedElement.model.get('widgetType')) { | |
return; | |
} | |
console.log('sectionName', sectionName); | |
console.log('editor', editor); | |
var isSideBSection = -1 !== ['section_form', 'fields_styles'].indexOf(sectionName); | |
editedElement.$el.toggleClass('test', isSideBSection); | |
}); |
NewerOlder