Skip to content

Instantly share code, notes, and snippets.

View DanielMarklund's full-sized avatar

Daniel Leis DanielMarklund

View GitHub Profile
@DanielMarklund
DanielMarklund / gist:3415529
Created August 21, 2012 13:39
Laravel - Navigation Active Class
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
@DanielMarklund
DanielMarklund / redis-write-permissions.php
Last active December 6, 2023 14:59
Give Redis write permissions when DISALLOW_FILE_MODS is enabled in WordPress
<?php
/**
* Class Redis_Write_Permissions
*
* This class is responsible for enabling write permissions for the Redis object cache drop-in
* when the DISALLOW_FILE_MODS constant is set to true, without having to disable DISALLOW_FILE_MODS.
*
* Notes: Use with https://wordpress.org/plugins/redis-cache/ (Redis Object Cache by Till Krüss)
* By default, the Redis Object Cache drop-in is not writeable when DISALLOW_FILE_MODS is set to true.
@DanielMarklund
DanielMarklund / limit-order-searches.php
Last active December 6, 2023 14:59
Limit order search fields in WooCommerce for speed optimization
<?php
/**
* Class Limit_Order_Search_Fields
*
* Limits WooCommerce order searches to email, phone, order ID, shipping & billing address indexes and name
* for admins and shop managers to limit optimize speed in order search.
*
* Installation: Place this file in the mu-plugins folder.
* If you do not have a mu-plugins folder you can create one in the wp-content folder.