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 | |
USER="root" | |
ExcludeDatabases="Database|information_schema|performance_schema|mysql" | |
databases=`mysql -u $USER -e "SHOW DATABASES;" | tr -d "| " | egrep -v $ExcludeDatabases` | |
for db in $databases; do | |
echo "Dumping database: $db" | |
mysqldump -u $USER --databases $db > `date +%Y%m%d`.$db.sql |
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
wget http://wordpress.org/latest.tar.gz && tar xfz latest.tar.gz && mv wordpress/* ./ && rmdir ./wordpress/ && rm -f latest.tar.gz |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Force SSL | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] |
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
// Create new DOMDocument | |
$cmb2_mb = new DOMDocument(); | |
// Load cmb2 metabox html string into document | |
$cmb2_mb->loadHTML( $form, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD ); | |
// Add bootstrap classes to all labels | |
foreach ( $cmb2_mb->getElementsByTagName( 'label' ) as $node_label ) { | |
$node_label->setAttribute( 'class', 'control-label' ); | |
} |
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
add_filter( 'install_plugins_tabs', 'cmfy_required_plugins_tab' ); | |
function cmfy_required_plugins_tab( $tabs ) { | |
$tabs['cmfy'] = _x( 'Required', 'Plugin Installer', 'cmfy' ); | |
return $tabs; | |
} | |
add_action( 'install_plugins_cmfy', 'cmfy_required_plugins_page' ); | |
function cmfy_required_plugins_page() { | |
$required_plugin_slugs = array( | |
'cmb2', |
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 | |
// Custom theme colors | |
$cmfy_custom_colors = array( | |
'14bed2' => __( 'Primary blue', 'cmfy' ), | |
'cadd69' => __( 'Primary green', 'cmfy' ), | |
'70736f' => __( 'Primary gray', 'cmfy' ), | |
'f26722' => __( 'Secondary orange', 'cmfy' ), | |
'fdbb4a' => __( 'Secondary yellow', 'cmfy' ), | |
); |
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 | |
/** | |
* Add a character counter to post excerpts in WordPress admin. | |
* Action: admin_head-post.php, admin_head-post-new.php | |
* Inspired by @link: https://premium.wpmudev.org/blog/character-counter-excerpt-box/ | |
*/ | |
function cmfy_excerpt_character_counter() { | |
// If post type does not support excerpt, do nothing | |
if ( ! post_type_supports( get_post_type(), 'excerpt' ) ) { | |
return; |
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 | |
/** | |
* Add guidance text to the featured image metabox. | |
* Filter: admin_post_thumbnail_html | |
* | |
* @param string $content Meta box HTML | |
* @param integer $post_id ID of post | |
* @return string | |
*/ | |
function cmfy_featured_image_help_text( $content, $post_id ) { |
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 | |
/** | |
* Add a help tab to the new/edit post screen. | |
* Action: admin_head-post.php, admin_head-post-new.php | |
*/ | |
function cmfy_add_gumbo_help_tab() { | |
// Get the WP_Screen object | |
$screen = get_current_screen(); | |
// Adjust / remove this conditional depending on which hook you're firing on |
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 | |
# This script creates a compressed backup archive of the given directory and the given MySQL table. More details on implementation here: http://theme.fm | |
# Feel free to use this script wherever you want, however you want. We produce open source, GPLv2 licensed stuff. | |
# Author: Konstantin Kovshenin exclusively for Theme.fm in June, 2011 | |
# Original link: https://theme.fm/a-shell-script-for-a-complete-wordpress-backup/ | |
# Set the date format, filename and the directories where your backup files will be placed and which directory will be archived. | |
NOW=$(date +"%Y-%m-%d-%H%M") |
OlderNewer