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
/** | |
* Here is a patch to bring Visual Composer into Event Espresso 4. | |
* | |
* Tested on Visual Composer 4.11 and Event Espresso 4. | |
* | |
* Instructions: | |
* 1) Add this to the end of functions.php or any is_admin() included file. | |
**/ | |
add_action('admin_print_scripts', function() { |
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 | |
/* | |
Plugin Name: Materialized Paths | |
Plugin URI: http://crumbls.com | |
Description: Implement materialized paths for WordPress to enable simple searching for child and parent paths. | |
Author: Chase C. Miller | |
Version: 2.0.1a | |
Author URI: http://crumbls.com | |
Text Domain: Crumbls\Plugins\Materialized | |
*/ |
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 | |
namespace Crumbls\Plugins\MetaBoxAlternate; | |
defined('ABSPATH') or exit(1); | |
/* | |
Plugin Name: Allow a filterd list for bloated category lists in the admin meta box | |
Plugin URI: http://crumbls.com | |
Description: Example of creating a third tab on the category selection box. We used it to give our Editorial department the categories that we use for news stories, not similar category names. |
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 | |
/** | |
* You can include this snippet anywhere. | |
* Just remove the reference once you're done. | |
* It checks to make sure files exist and are readable. | |
* | |
* If WP Offload S3 Lite is not installed, this won't do anything other than waste resources. | |
* | |
* Love the full plugin? Buy it! |
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 | |
/* | |
Plugin Name: Plugin Debugging Tool | |
Description: Attempt to automatically de-activate plugins that are causing errors. Doesn't always work. This must be installed in the mu-plugins directory. | |
Author: Chase C. Miller | |
Version: 1.0 | |
Author URI: http://crumbls.com | |
*/ | |
namespace Crumbls\Debug\Plugins; |
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 | |
defined('ABSPATH') || exit(1); | |
add_filter('the_permalink', 'thePermalinkPDF'); | |
add_filter('attachment_link', 'thePermalinkPDF'); | |
// Automatically convert permalinks to PDFs in search results to the PDF itself, not the Attachment page | |
function thePermalinkPDF($permalink){ | |
global $post; | |
if (get_post_mime_type($post->ID) != 'application/pdf') { |
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 | |
/** | |
* Author: Chase C. Miller | |
* Working Date: 2017-01-11 | |
* Custom cache key for WPEngine to bypass object caching problems that can happen when you install a secondary or multisite on WPEngine. | |
* It should be installed as a mu-plugin to catch early activation. | |
**/ | |
global $wp_object_cache; |
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 | |
// Customize this. | |
namespace Crumbls\ExtendedData\Traits; | |
use Str; | |
use Illuminate\Support\Facades\Cache; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\Facades\DB; |
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 | |
namespace App\Traits; | |
use Illuminate\Support\Facades\Hash; | |
/** | |
* Trait HasPasswordAttribute | |
* @package App\Traits | |
*/ |
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
This is a very inefficient way to do it once the db is huge. But it works. For the example, the user id is 5. | |
$userId = 5; | |
\DB::statement('SET @row=0'); | |
$user = \App\Models\User::whereRaw('1=1') | |
->select([ | |
\DB::raw('@row:=@row+1 as row'), | |
\DB::raw('count(*) as c'), | |
'users.*' | |
]) |
OlderNewer