Skip to content

Instantly share code, notes, and snippets.

View Lonsdale201's full-sized avatar

Soczó Lonsdale201

View GitHub Profile
@Lonsdale201
Lonsdale201 / gist:726c1ddfe03b18145759a94357477fb6
Created November 28, 2023 12:38
JetEngine - Custom Macro - Current user Memberships (multiple support)
// place the code in the child theme functions.php or a custom code snippets plugin.
// how to use
// Create a new User Query in the Query builder.
// Go to the Include/exclude section
// Click the Dynamic tag icon, and select the WC Current User memberships macro. In the text field write your membership IDs and done.
// this version can handle multiple memberip id's
// Include or Exclude can apply this macro.
// This macro will return the selected user id
// If the membership ID not exist, or not have user with selected ID membership active, will return
// My all Gist: https://gist.github.com/Lonsdale201
@Lonsdale201
Lonsdale201 / gist:24c66ac2f324de52d8585916a5d21a96
Last active November 28, 2023 12:42
JetEngine - Custom Macro - Current user Membership
// place the code in the child theme functions.php or a custom code snippets plugin.
// how to use
// Create a new User Query in the Query builder.
// Go to the Include/exclude section
// Click the Dynamic tag icon, and select the WC Current User membership macro. In the text field write your membership ID and done.
// Include or Exclude can apply this macro.
// This macro will return the selected user id
// If the membership ID not exist, or not have user with selected ID membership active, will return
// My all Gist: https://gist.github.com/Lonsdale201
@Lonsdale201
Lonsdale201 / gist:492fd40b98b47c52b8bc963b35522955
Created November 28, 2023 10:06
JetEngine - Custom Macro - Current user email
add_action( 'jet-engine/register-macros', function(){
class Current_User_Email extends \Jet_Engine_Base_Macros {
public function macros_tag() {
return 'current_user_email';
}
public function macros_name() {
return 'Current user email';
@Lonsdale201
Lonsdale201 / gist:aa2740c1fe926b74d79971356fea304e
Created November 22, 2023 20:14
Elementor Wordpress menü widget kattintás szimuláció
// az elem, amire kattintva, szimulációt kell leadni az elementor Wp menü widgetre, add meg ezt az ID: triggerelement
// másold a kódot egy megfelelő js fájlba vagy használd az Elementor custom code funkciót
// verzió 1 csak kinyitás
<script>
document.addEventListener('DOMContentLoaded', function () {
var triggerElement = document.getElementById('triggerelement');
if (triggerElement) {
@Lonsdale201
Lonsdale201 / gist:cd73b2340a0ca12697a3c92763c61dea
Last active November 23, 2023 13:10
JetSmartfilter Checkbox filter - Group parent toggle
// make your Checkbox filter, and ensure that "Group terms by parents" option is checkhed.
// In the Checkbox filter widget enable the Dropdown additions. You can use the search option also. (Mixed filter type not tested)
// Paste this code in a specific js file, plugin, or use the Elementor custom code function. (if elementor custom code, dont forget to
// use the tags, like <script> and <style>
// Multi level not tested, only one level.
// Warning this script will affect all of your checkbox filter, where you settinged up the "Group terms by parents" option.
// PREVIEW : https://prnt.sc/5fPJ6iebdDCy
@Lonsdale201
Lonsdale201 / gist:4707959f44a93a363e71347e0bd33123
Created November 9, 2023 23:59
WooCommerce Points and Rewards get current user point balance shortcode
function hw_current_user_points_shortcode() {
// Csak bejelentkezett felhasználóknál jelenjen meg valami
if ( is_user_logged_in() ) {
$user_id = get_current_user_id();
// A felhasználó pontegyenlegének lekérdezése a WC_Points_Rewards_Manager osztály használatával
$points = WC_Points_Rewards_Manager::get_users_points( $user_id );
// Ellenőrizzük, hogy a felhasználónak van-e pontja
if ( empty( $points ) ) {