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
import { Fragment, useCallback } from '@wordpress/element'; | |
import { useDispatch, useSelect } from '@wordpress/data'; | |
const useMeta = ( key ) => { | |
const meta = useSelect( ( select ) => { | |
const { getEditedPostAttribute } = select( 'core/editor' ); | |
const values = getEditedPostAttribute( 'meta' ) || {}; | |
return values[ key ] || ''; | |
}, [] ); |
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
// Builderオブジェクトの型 | |
type Builder<Props, Result> = ({} extends Props | |
? { | |
build: () => Result; | |
} | |
: {}) & | |
{ [P in keyof Props]-?: SetFunction<Props, P, Result> }; | |
type SetFunction<Props, K extends keyof Props, Result> = ( | |
value: Exclude<Props[K], undefined> |
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
./letsencrypt-auto certonly --apache --keep -d extendwings.com -d www.extendwings.com | |
./letsencrypt-auto certonly --apache --keep -d aigis.pw | |
./letsencrypt-auto certonly --apache --keep -d shield-9.org | |
sudo apachectl graceful |
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
{ | |
"DistributionConfig": { | |
"Comment": "", | |
"CacheBehaviors": { | |
"Items": [ | |
{ | |
"TrustedSigners": { | |
"Enabled": false, | |
"Quantity": 0 | |
}, |
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/env bash | |
set -ex; | |
# WordPressをec2-user権限で動かすように設定を変更 | |
curl -L https://raw.githubusercontent.com/amimoto-ami/run-httpd-as-ec2-user/master/run-httpd-as-ec2-user.sh | sudo bash | |
# WordPressのセットアップ | |
wp --path=/var/www/vhosts/$(curl -L http://169.254.169.254/latest/meta-data/instance-id) \ | |
core install \ |
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
<h1>見出し壱:夏目漱石著『吾輩は猫である』</h1> | |
<h2>見出し弐:レオ・レオニ作『スイミー 小さなかしこいさかなのはなし』</h2> | |
<h3>見出し参:あまん きみこ作、上野 紀子絵『ちいちゃんのかげおくり』</h3> | |
<h4>見出し四:モンゴルの民話『スーホの白い馬』</h4> | |
<h5>見出し五:新美南吉作『手袋を買いに』</h5> | |
<h6>見出し六:芥川龍之介著『羅生門』</h6> | |
<h2>引用 (Blockquote) テスト</h2> | |
<blockquote>これは言語みたいなものだ。アルファベットすなわち音階を学び、文すなわちコードを学ぶ。そしてやがてホーンと即興で会話するようになる。即興で話すのはすばらしいことだと思うが、私には決して会得できないだろう。しかし音楽ともなれば、私は即座によろこんで会話する。そう、それがジャズ音楽のすべてだ。 | |
<cite>スタン・ゲッツ</cite></blockquote> |
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 | |
/** | |
* @package Structured Data of JSON-LD | |
* @version 2.0 | |
*/ | |
/* | |
Plugin Name: Structured Data of JSON-LD | |
Plugin URI: http://wordpress.org/plugins/ejls-easy-json-ld-setter/ | |
Description: Set Structured Data of "JSON-LD" to your WebSite.schema type that you can use is "Article","Person","WebSite" and "searchAction". | |
Author: Hidetaka Okamoto |
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 | |
$version = 'default'; | |
$stylesheet_dir = get_stylesheet_directory(); | |
if ( file_exists( $stylesheet_dir.'/.git/HEAD' ) ) { | |
$head = explode(' ', trim(file_get_contents($stylesheet_dir.'/.git/HEAD')) ); | |
if ( isset($head[1]) && file_exists($stylesheet_dir.'/.git/'.$head[1]) ) { | |
$version = trim(file_get_contents($stylesheet_dir.'/.git/'.$head[1])); | |
} | |
} | |
define( 'THEME_VERSION', $version ); |
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 redirect_login_front_page() { | |
if( !current_user_can('administrator') ){ | |
$home_url = site_url('', 'http'); | |
wp_safe_redirect($home_url); | |
exit(); | |
} | |
} |
NewerOlder