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 | |
require_once( 'wp-load.php' ); //スクリプト設置位置によってパスを変える | |
$users = get_users(); | |
foreach ( $users as $user ) { | |
wp_update_user( array( 'ID' => $user->ID, 'user_email' => $user-> user_email.'.example') ); | |
} |
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
const ACCESS_KEY = '<ACCESS_KEY>'; | |
const SECRET_KEY = '<SECRET_KEY>'; | |
var AWS = require('aws-sdk'); | |
AWS.config.update({accessKeyId: ACCESS_KEY, secretAccessKey: SECRET_KEY}); | |
exports.handler = function(event, context) { | |
var opsworks = new AWS.OpsWorks(); | |
opsworks.describeInstances( {InstanceIds : [event.instance_id]},function(err, data) { | |
if (err) { |
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_menu', 'my_plugin_menu'); | |
function my_plugin_menu() { | |
global $my_plugin_page; | |
$my_plugin_page = add_options_page('My Plugin Options', 'My Plugin', 'Administrator', __FILE__, 'my_plugin_options'); | |
add_action("load-$my_plugin_page", my_screen_options); | |
} | |
function my_screen_options() { | |
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_filter( 'tr_subject_admin_mail', 'my_tr_subject_admin_mail', 10, 3 ); | |
function my_tr_subject_admin_mail( $subject, $data, $id ) { | |
$responce = get_post_meta( $id, 'answer' ); | |
krsort($responce); | |
$entry_id = key($responce); | |
return $subject . '[id:'.$entry_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_action('init', 'my_cron_schedule'); | |
function my_cron_schedule() { | |
if ( get_option('my_cron_schedule_locked') == 1 ) | |
return; | |
$crons = _get_cron_array(); | |
foreach ( $crons as $time => $time_cron_array ) { | |
if ( array_key_exists( 'my_cron_schedule_handler', $time_cron_array ) ) { |
NewerOlder