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 | |
/* | |
Plugin Name: デバッグ用 | |
Description: WooCommerce サイトで予約投稿が実行されているかログを取った時に使ったプラグイン | |
Author: ko31 | |
Author URI: https://go-sign.info | |
*/ | |
add_action( 'publish_future_post', function( $post_id ) { | |
if ( function_exists( 'wc_get_logger' ) ) { | |
$logger = wc_get_logger(); |
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
curl --user apikey:[REPLACE YOUR API KEY] --request POST --header "Content-Type: application/json" --data '{"text":"this is a pen","source":"en","target":"zh-TW"}' "https://gateway.watsonplatform.net/language-translator/api/v3/translate?version=2018-05-01" |
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 | |
/** | |
* WP Show Posts のデータ表示条件を PHP から変更するサンプル | |
*/ | |
add_filter( 'wpsp_settings', function( $settings ) { | |
// 検索対象をカテゴリーにする | |
$settings['taxonomy'] = 'category'; |
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 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/sh | |
wp term create initial "あ" --slug="a" | |
wp term create initial "い" --slug="i" | |
wp term create initial "う" --slug="u" | |
wp term create initial "え" --slug="e" | |
wp term create initial "お" --slug="o" | |
wp term create initial "か" --slug="ka" | |
wp term create initial "き" --slug="ki" | |
wp term create initial "く" --slug="ku" | |
wp term create initial "け" --slug="ke" |
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
あ | a | |
---|---|---|
い | i | |
う | u | |
え | e | |
お | o | |
か | ka | |
き | ki | |
く | ku | |
け | ke | |
こ | ko |
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/sh | |
wp term create prefecture "北海道" --slug="hokkaido" | |
wp term create prefecture "青森" --slug="aomori" | |
wp term create prefecture "岩手" --slug="iwate" | |
wp term create prefecture "宮城" --slug="miyagi" | |
wp term create prefecture "秋田" --slug="akita" | |
wp term create prefecture "山形" --slug="yamagata" | |
wp term create prefecture "福島" --slug="fukushima" | |
wp term create prefecture "茨城" --slug="ibaraki" | |
wp term create prefecture "栃木" --slug="tochigi" |
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/sh | |
# Delete post type 'your-post-type' | |
for i in `seq 1 10` | |
do | |
wp post delete $(wp post list --post_type='your-post-type' --format=ids --posts_per_page=10000) --force | |
done | |
echo "done" |
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
DELETE | |
POST, | |
POST_META, | |
ATT, | |
ATT_META | |
FROM wp_posts POST | |
LEFT JOIN wp_postmeta POST_META | |
ON POST.ID = POST_META.post_id | |
LEFT JOIN wp_posts ATT | |
ON POST.ID = ATT.post_parent |
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/sh | |
SOURCE=images/* | |
for file in ${SOURCE}; do | |
mime=$( file -b --mime "${file}" | grep -o '.*;' ) | |
case $mime in | |
"image/bmp;" ) ext=bmp ;; |