SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes'
UNION SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes'
UNION (SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 10);
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
# Choose from an array of strings | |
echo "Please choose the environment" | |
local envs=('staging' 'pre-live' 'live') | |
select env in "${envs[@]}" | |
do | |
case $env in | |
"staging") break;; | |
"pre-live") break;; | |
"live") break;; | |
"Quit") break;; |
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
-- Delete all of posts of custom post type | |
DELETE FROM `wp_posts` WHERE `post_type` = 'post-type'; | |
-- Delete all unpublished of custom post type | |
DELETE FROM `wp_posts` WHERE `post_status` = 'draft' and `post_type` = 'post-type'; |
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 | |
// --- Create a shortcode | |
// @Usage: [shortcode_name count="1"] | |
function theme_shortcode_add_name($args) { | |
$html = ''; | |
$count = !empty($args['count']) ? $args['count'] : 5; | |
return $html; | |
} | |
add_shortcode( 'shortcode_name', 'theme_shortcode_add_name' ); |
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
/* Compiled CSS from Bootstrap 4's responsive embeds */ | |
.embed-responsive { | |
position: relative; | |
display: block; | |
width: 100%; | |
padding: 0; | |
overflow: hidden | |
} | |
.embed-responsive::before { | |
display: block; |
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 | |
/* Email Subscribers & Newsletters - by Icegram (https://wordpress.org/plugins/email-subscribers) | |
These functions allow you to subscribe/unsubscribe a user to an email group without using a signup form. */ | |
/** | |
* Subscribe a user to a given newsletter group | |
* | |
* @param $user_id | |
* @param $group | |
* @throws Exception |
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
javascript:(function () { | |
window.fsd = {}; | |
const TOO_MANY_FONT_SIZES = 10; | |
fsd.nukeResults = () => { | |
let $result = document.querySelector('.fs-result'); | |
if ($result !== null) { | |
$result.style.display = 'none'; | |
} |
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
# --mirror: Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings | |
# --page-requisites: This option causes Wget to download all the files that are necessary to properly display a given HTML page. This includes such things as inlined images, sounds, and referenced stylesheets. | |
# --adjust-extension: If a file of type application/xhtml+xml or text/html is downloaded and the URL does not end with the regexp \.[Hh][Tt][Mm][Ll]?, this option will cause the suffix .html to be appended to the local filename. | |
# --convert-links: After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc. | |
wget --mirror --page-requisites --adjust-extension --convert-links https://www.website.com |
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 | |
/** | |
* This class gets around a limitation of the Gravity Forms User Registration Add-On that limits you to | |
* one type of User Registration feed per form: Create OR Update. | |
* https://www.gravityforms.com/add-ons/user-registration/. | |
* | |
* We use this plugin in membership application forms. | |
* Membership application forms are used by both logged-in and logged-out users. | |
* Being able to use a Create AND Update feed allows us share one membership form. |
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 | |
// nkowald - The only way to hide Ticket ID and Security Code is using the tribe_tickets_plus_woo_meta_data_enabled filter. | |
/** | |
* Echoes attendee meta for every attendee in selected order | |
* | |
* @since 5.2.7 | |
* | |
* @param string $order_id Order or RSVP post ID. | |
* @param string $ticket_id The specific ticket to output attendees for. |