Skip to content

Instantly share code, notes, and snippets.

@WordBits
WordBits / snippet.php
Created August 24, 2018 17:32
testing things
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/testing/
// Created by: Rob Landers
?>
<?php
echo "hello world";
@WordBits
WordBits / snippet.php
Created August 24, 2018 14:23
Enables maintenance mode for all non-admin users and displays a simple maintenance message. Perfect for those times that you need to quickly enable maintenance mode without extra plugins or configurations.
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/simple-maintenance-mode/
// Created by: jeffmatson
?>
<?php
function wordbits_simple_maintenace_mode() {
if ( ! current_user_can( 'manage_options' ) || ! is_user_logged_in() ) {
die('Maintenance.');
}
@WordBits
WordBits / snippet.php
Created August 24, 2018 14:20
This snippet will allow you to automatically empty your post, page, or comment trash inside WordPress. Helpful when you need to keep performance high but don't want to manually go in and delete things from trash. By default, this snippet will delete items from the trash after being there for 7 days. As always, adjust it to your needs as you see …
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/automatically-empty-post-page-comment-trash/
// Created by: jeffmatson
?>
<?php
define('EMPTY_TRASH_DAYS', 7 );
@WordBits
WordBits / snippet.php
Created August 24, 2018 14:16
If you're getting an error that your memory limit has been exhausted, or have updated your memory limit in your php.ini but still aren't getting the results you're looking for, here's how to increase it.
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/increasing-your-php-memory-limit/
// Created by: jeffmatson
?>
<?php
define('WP_MEMORY_LIMIT', '128M');
@WordBits
WordBits / snippet.php
Created July 19, 2018 13:28
Example Test Snippet
<?php
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/example-test-snippet/
// Created by: jeffmatson
?>
<?php
dsfdsfdsfsdf
@WordBits
WordBits / snippet.php
Created July 18, 2018 05:47
asdfasdfs
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfasdf/
// Created by: jeffmatson
?>
<?php
asdfasdfasdf
@WordBits
WordBits / snippet.php
Created July 18, 2018 05:38
asdfasdfasdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/afdsafasdf/
// Created by: jeffmatson
?>
<?php
sadfasdfsdf
@WordBits
WordBits / snippet.php
Created July 18, 2018 05:33
asdfasdf
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfasdf/
// Created by: jeffmatson
?>
<?php
asdfasdf
@WordBits
WordBits / snippet.php
Created July 18, 2018 05:31
asdfasdfasd
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asfasdf/
// Created by: jeffmatson
?>
<?php
asdfasdfsadf
@WordBits
WordBits / snippet.php
Created July 18, 2018 05:30
asdfasdfa
<?php
// Download this snippet as a plugin and more at: https://wordbits.localhost/snippet/asdfasdf/
// Created by: jeffmatson
?>
<?php
asdfasdf