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 | |
/** | |
* Implements `media-count` command. | |
*/ | |
class WPCLI_Media_Library_Count { | |
/** | |
* Get total count of all media and break down counts for each media type. | |
* | |
* ## EXAMPLES | |
* |
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 | |
const FORCE_UPLOAD_DIR_SUBDIR_TO = '/1990/08'; // MUST be "/YYYY/MM" format. | |
/** | |
* Force uploads to land in a specific /YYYY/MM folder. | |
* | |
* @param array $uploads information about the upload directory | |
* @see https://github.com/WordPress/WordPress/blob/2b92bcab85cecd819596b79b0b52f44aa4dfaffa/wp-includes/functions.php#L2223-L2239 | |
* @return array |
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 | |
/** | |
* List off all plugins used via `[list_plugins]` shortcode. | |
* | |
* Note that this includes inactive plugins, so keep the plugins tidy. | |
* | |
* @return string of html, list of plufins and links to their site. | |
*/ | |
add_shortcode('list_plugins', 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 | |
/** | |
* Set all enqueued scripts except jQuery to include the `async` attribute. | |
* | |
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#Attributes | |
*/ | |
add_filter('script_loader_tag', function ($tag, $handle) { | |
if ( 'jquery' !== $handle ) | |
return $tag; |
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 | |
/** | |
* Disable default Widgets | |
* | |
* @see https://digwp.com/2014/02/disable-default-dashboard-widgets/ | |
*/ | |
add_action('wp_dashboard_setup', function () { | |
global $wp_meta_boxes; | |
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 | |
/** | |
* Sword Toolkit configuration | |
* | |
* @see https://github.com/davidsword/sword-toolkit | |
*/ | |
add_filter('sword_toolkit', function() { | |
return [ | |
'remove_blog' => true, |
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
.status-bar-left .ftp-statusbar-view { | |
.icon { | |
color: white !important; | |
position: relative; | |
z-index: 2; | |
&:after { | |
content: ""; | |
display: block; | |
position: absolute; | |
width: 30px; |
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 | |
/** | |
* Use a plugins template file, unless one exists in theme. | |
* | |
* Useful when creating custom post types, allowing themes to create | |
* their own template. | |
*/ | |
add_filter('template_include', function ( $template ) { | |
if ( is_singular( 'location' ) ) { // `location` is a custom 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 | |
/** | |
* Implements `dsca` command. | |
*/ | |
class DSCA_Helpers { | |
/** | |
* Change a custom 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
#!/bin/bash | |
S3DIR="s3://BUCKET_NAME" | |
BACKUPPATH=/tmp/backups | |
SITESTORE=/var/www | |
SITE=public_html | |
DATEFORM=$(date +"%Y-%m-%d") | |
DAYSKEEP=7 |