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 | |
// Don't email webmaster for comment moderation | |
function pref_dont_email_webmaster( $emails, $comment_id ) { | |
$webmaster_email = get_option('admin_email'); | |
if ( $emails[0] == $webmaster_email ) | |
unset($emails[0]); | |
return (array) $emails; | |
} |
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 | |
function my_backup_scheduler( $event ) { | |
// 'wp_maybe_auto_update' is the cron hook for the auto update process | |
if ( 'wp_maybe_auto_update' !== $event['hook'] ) | |
return; | |
wp_schedule_single_event( $event['timestamp'] - 5 * MINUTE_IN_SECONDS, 'my_backup' ); | |
} | |
add_filter( 'schedule_event', 'my_backup_scheduler', 10, 1 ); |
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_action( 'admin_init', 'wprss_et_activate_deactivate_license' ); | |
/** | |
* Handles the activation/deactivation process | |
* | |
* @since 1.1 | |
*/ | |
function wprss_et_activate_deactivate_license() { | |
// listen for our activate button to be clicked |
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 "Download" custom type for tutorial on Jayj.dk | |
* | |
* @link http://jayj.dk/2011/download-cpt-wordpress | |
*/ | |
add_action( 'init', 'jayj_create_download_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
function dap_responsive_img_caption_filter( $val, $attr, $content = null ) { | |
extract( shortcode_atts( array( | |
'id' => '', | |
'align' => '', | |
'width' => '', | |
'caption' => '' | |
), $attr | |
) ); | |
if ( 1 > (int) $width || empty( $caption ) ) |
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
#!/usr/bin/php | |
<?php | |
// Install these with PEAR | |
require_once 'Console/CommandLine.php'; | |
require_once 'Console/Color.php'; | |
require_once 'Console/ProgressBar.php'; | |
define('NL', "\n"); |
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 | |
# Simple MySQL dump script which dumps each database to a compressed | |
# file with the date included in the file name | |
MYSQL='/usr/bin/mysql' | |
MYSQLDUMP='/usr/bin/mysqldump' | |
DUMPOPTS='--opt --hex-blob --skip-extended-insert' |
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
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |