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 | |
/** | |
* mdm_wp_multiple_categories.php | |
* | |
* Find out if your WordPress blog contains posts with more than one category. | |
* | |
* Use as a standalone page or a function with WordPress. | |
* | |
* Function uses param to return string message or count of posts with multiple categories. | |
*/ |
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 | |
# import_wordpress_db_to_localhost.sh | |
# | |
# Easy to use to with multiple sites. | |
# Try: | |
# alias import_blog='import_wordpress_db_to_localhost.sh DB SQL user password' | |
# | |
if [ ! -z $1 ] && [ ! -z $2 ] && [ ! -z $3 ] && [ ! -z $4 ] && [ -f $2 ]; then | |
echo "Updating $1 with $2 and local settings" | |
# import database |
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 | |
/** | |
* WordPress filter to modify the default Quick Mail sending permission. | |
* | |
* @param string $qm_user_capability | |
* @return string new requirement | |
* @link https://github.com/mitchelldmiller/quick-mail-wp-plugin | |
*/ | |
function qm_sender_capability( $qm_user_capability ) | |
{ |
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 | |
/** | |
* WordPress filter to allow editors to edit Quick Mail user display options. | |
* | |
* @param string $qm_user_capability | |
* @return string new requirement | |
* @link https://github.com/mitchelldmiller/quick-mail-wp-plugin | |
*/ | |
function qm_setup_capability( $qm_user_capability ) | |
{ |
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 | |
// quick-mail-first-name-shortcode.php | |
/** | |
* get first name of Quick Mail recipient. | |
* for shortcode to add recipient's first name to Quick Mail email message. | |
* @return string first name of recipient or email address. question mark is n/a. | |
* @see https://wheredidmybraingo.com/tag/quick-mail/ Quick Mail WordPress Plugin | |
* @see https://wordpress.org/support/topic/add-user-name-to-email/ support request | |
*/ | |
function qm_get_first_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
#! /bin/bash | |
rm -f index.php | |
rm -f license.txt | |
rm -f readme.html | |
rm -f wp-activate.php | |
rm -rf wp-admin | |
rm -f wp-blog-header.php | |
rm -f wp-comments-post.php | |
rm -f wp-config-sample.php | |
rm -f wp-cron.php |
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 | |
if [ ! -z $1 ]; then | |
if [[ "$PWD" =~ "plugins" ]]; then | |
curl -OkLs https://downloads.wordpress.org/plugin/$1.zip | |
if [ -f $1.zip ]; then | |
if [ -d $1 ]; then | |
rm -rf $1 | |
fi # if directory exists | |
unzip -qq $1.zip | |
rm -f $1.zip |
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 | |
// get email addresses for a role. | |
// Usage: http://example.com/qm_wp_roles.php?role=author | |
require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php'; | |
header( 'Content-type: text/plain' ); | |
$input = empty( $_GET['role'] ) ? '' : strtolower( $_GET['role'] ); | |
if ( empty( $input ) ) { | |
echo qm_show_usage(); | |
exit; |
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 | |
/** | |
* Example of checking for a banned domain from a standalone page. | |
* Requires Quick Mail plugin version 4.0.5 or greater. | |
*/ | |
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php'); | |
$domain = empty($_GET['domain']) ? 'example.com' : $_GET['domain']; | |
$desc = empty(QuickMailUtil::acceptable_domain($domain)) ? 'BANNED' : 'OK'; | |
wp_die("{$domain} = {$desc}", $domain); | |
exit; |