This file contains hidden or 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
Using FTP/SSH & Database | |
This method allows you to delete all items in your media library at once. Be sure to backup your database prior to doing this. | |
Each file in your media library has one row in the `wp_posts` table and two rows in the `wp_postmeta` table. Learn more about how WordPress stores media library entries in the database here. You can delete them all in bulk using these commands: | |
DELETE FROM `wp_posts` WHERE `post_type` = "attachment"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attached_file"; | |
DELETE FROM `wp_postmeta` WHERE `meta_key` = "_wp_attachment_metadata"; |
This file contains hidden or 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 | |
/** | |
* WordPress Gutenberg gallery block fix to the gallery shortcode. | |
*/ | |
/** | |
* Replace Gutenberg gallery block with the gallery shortcode. | |
* Tested until Gutenberg 2.4 | |
* |
This file contains hidden or 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
// Demo http://codepen.io/AlexEmashev/pen/BKgQdx | |
(function ($) { | |
$.fn.swipeDetector = function (options) { | |
// States: 0 - no swipe, 1 - swipe started, 2 - swipe released | |
var swipeState = 0; | |
// Coordinates when swipe started | |
var startX = 0; | |
var startY = 0; | |
// Distance of swipe | |
var pixelOffsetX = 0; |
This file contains hidden or 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
## Pre-requisite: You have to know your last commit message from your deleted branch. | |
git reflog | |
# Search for message in the list | |
# a901eda HEAD@{18}: commit: <last commit message> | |
# Now you have two options, either checkout revision or HEAD | |
git checkout a901eda | |
# Or | |
git checkout HEAD@{18} |
This file contains hidden or 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 | |
/* | |
* Virtual Themed Page class | |
* | |
* This class implements virtual pages for a plugin. | |
* | |
* It is designed to be included then called for each part of the plugin | |
* that wants virtual pages. | |
* | |
* It supports multiple virtual pages and content generation functions. |
This file contains hidden or 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
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name` |