Skip to content

Instantly share code, notes, and snippets.

// consulente error checks
consulente_errors_list = [];
$('#detrazione-fiscale-consulente .consulente-checK input[type="checkbox"]').change(function () {
consulente_errors_list = $('#detrazione-fiscale-consulente .consulente-checK input[type="checkbox"]:checked').map(function (i) {
var classes = $(this).closest('.cmb-row').attr('class');
var error_el = '.' + classes.match("cmb2-id-([a-zA-Z\-]+)")[1];
//console.log(consulente_errors_list);
//console.log(error_el);
@bUxEE
bUxEE / wp-recursive-menu.php
Last active April 28, 2024 15:07
Recursive menu/submenu list from wp_get_nav_menu_items. Change menu name and style to your needs. Supports unlimited number of submenus.
<?php
$menu_name = 'menu-name';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
//echo '<pre>'.print_r($menuitems).'</pre>';
function buildTree( array &$elements, $parentId = 0 )
{
@bUxEE
bUxEE / find_string.php
Last active July 23, 2025 01:02
find string in file (search in directory and subdirectories) php
<?php
$string = 'stringToSearch';
$dir = new RecursiveDirectoryIterator('folder');
foreach (new RecursiveIteratorIterator($dir) as $filename => $file) {
//$thename = $file->getFilename(); //uncomment this line and next to print names of all files scanned
//echo $thename.'<br />';
$content = file_get_contents($file->getPathname());
if (strpos($content, $string) !== false) {
@bUxEE
bUxEE / auto-img-alt.php
Last active March 29, 2017 14:16
Automate images with missing alt tags using image filename - Wordpress
<?php
//////////////////////////////////////////////////////////////
///////// AUTOMATE ALT TAGS FOR IMAGES
//////////////////////////////////////////////////////////////
function image_alt_tag($content) {
global $post;
preg_match_all('/<img (.*?)\/>/', $content, $images);
if(!is_null($images)) {
foreach($images[1] as $index => $value) {
if(!preg_match('/alt=/', $value) && preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $value)) {
@bUxEE
bUxEE / associative_value_sort.php
Created March 26, 2017 14:09
Associative array sort by value
<?php
usort($array, function($a, $b) { if($a['key']==$b['key']) return 0; return $a['key'] > $b['key']?1:-1; });
?>
@bUxEE
bUxEE / boot-hamb-2.css
Created March 24, 2017 11:07
bootstrap hamburger animation
/* HAMBURGER ANIMATION 2
created by bux www.woptima.com */
.navbar-toggle{
-webkit-transition: transform;
transition: transform;
-webkit-transition-duration: 300ms;
transition-duration: 300ms;
-webkit-transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);
transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);
@bUxEE
bUxEE / gf_css.css
Created March 21, 2017 09:19
Gravity forms css styling
/* GRAVITY FORMS */
select:focus, input[type="file"]:focus, input[type="radio"]:focus {
outline: none !important;
}
.gform_wrapper .gform_body {
width:100%!important;
}
@bUxEE
bUxEE / gf_bs_check.css
Created March 21, 2017 09:16
Gravity forms fontawesome checkbox css
/* checkboxes */
.checkboxer>.gfield_label {
display: inline-block !important;
padding-left: 15px !important;
width: calc(100% - 30px) !important;
float: right;
}
.gfield_checkbox, .gfield_checkbox li, .ginput_container_checkbox {
width: auto !important;
@bUxEE
bUxEE / footer-sticky.js
Last active March 24, 2017 11:11
Stick footer bottom
@bUxEE
bUxEE / woo-snipp.php
Last active December 11, 2022 08:07
woocoommerce snippets
<?php
//////////////////////////////////////////////////////////////
// WOO COMMERCE SNIPPETS
//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// PAYMENT TYPE IN MAIL
///////////////////////////////////////////////////////////
add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 );