This file contains hidden or 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
/* | |
* WP REST API version 1.2.4 | |
* API base url ishttp://www.example.com/wp-json | |
* | |
* Reference | |
* https://wordpress.org/support/topic/new-post-with-image | |
*/ | |
/* | |
* Get Guzzle HTTP Client. That client has been authenticated. | |
*/ |
This file contains hidden or 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
HomebrewでインストールしたPHP5.6のビルトインサーバーをPhpStormでデバッグする手順です。 | |
* Xdebugはインストール済みであることを前提とします。 | |
* MacOSでターミナルを利用します。 | |
# Xdebugの設定ファイルを見つける | |
$ php --info | "grep \.ini" |
This file contains hidden or 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
<video width="465" height="260" src="sample.mp4" poster="sample.jpg" preload="none" controls> | |
<source src="sample.mp4" type="video/mp4"> | |
<object data="sample.mp4" width="465" height="260"> | |
<embed width="465" height="260" src="sample.mp4"> | |
</object> | |
<p>本ブラウザはvideoタグをサポートしておりません。</p> | |
</video> |
This file contains hidden or 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
/** | |
* Get current page uri | |
* | |
* @return string current page uri. | |
*/ | |
private function getUrl() { | |
if ( isset( $_SERVER['HTTPS'] ) AND $_SERVER['HTTPS'] == 'on' ) { | |
$uri = 'https://'; | |
} else { | |
$uri = 'http://'; |
This file contains hidden or 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
add_action( 'admin_enqueue_scripts', 'example_register_script', 10 ); | |
function example_register_script() { | |
wp_enqueue_media(); /* WordPressのメディアアップローダーを利用可能にします。 */ | |
wp_enqueue_script( | |
'example-uploader', | |
/path/to/example-uploader.js', | |
array( 'jquery' ), | |
'1.0.0', | |
false | |
); |
This file contains hidden or 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
/** | |
* クエリ文字列構築 | |
* | |
* @param array $params key/value pair | |
* | |
* @return array クエリ文字列 | |
*/ | |
public static function get_end_point( $params ) { | |
// クエリ文字列構築 |
This file contains hidden or 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
// オプション取得 | |
$options = (array) json_decode( get_option( 'key' ) ); |
This file contains hidden or 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
/** | |
* POSTパラメーター取得 | |
* | |
* POSTメソッドのパラメーターをJSON形式で返します。 | |
* | |
* @method getData | |
* @public | |
* | |
* @param {Array} ids コントロールのid配列です。 | |
* @return {Mixed(JSON|Boolean)} POSTパラメーターをJSON形式で返します。 |
This file contains hidden or 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
/** | |
* オフセット設定 | |
* | |
* @method | |
* @private | |
* @param {jQuery} elem オフセットを設定する要素です。 | |
* @param {Object} initial 要素の初期の大きさです。 | |
* @param {Int} initial.width 初期の幅です。 | |
* @param {Int} initial.height 初期の高さです。 | |
* @returns {Function} |