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 | |
/** | |
* クラス内で定義されたactionを削除する | |
* | |
* @param string $tag 削除したいfilter名 | |
* @param string $class 削除したいメソッドを内容するclass名 | |
* @param string $method 削除したいメソッド名 | |
* @param intger $priority 優先度 | |
* @return bool 削除の結果 | |
*/ |
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 | |
//キーの取得はこちらを参考に | |
//https://alaki.co.jp/blog/?p=2636 | |
require_once './vendor/autoload.php'; | |
use Google\Cloud\Translate\TranslateClient; | |
//「TranslateClient」クラスを呼び出し |
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 | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'array_syntax' => [ | |
'syntax' => 'short', | |
], | |
'blank_line_before_return' => true, | |
'function_typehint_space' => true, | |
'method_separation' => true, | |
'no_unused_imports' => true, |
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
<script src="https://www.youtube.com/iframe_api""></script> | |
<!-- html設定サンプル --> | |
<div class="js-apiLoader" data-ytid="wUn05hdkhjM" data-an="{event}|{eventCategory}|{eventAction}|{eventLabel}"></div> | |
<div class="js-apiLoader" data-ytid="AhgwJyMPGNU" data-an="{event}|{eventCategory}|{eventAction}|{eventLabel}"></div> |
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 | |
//xxxはMW WP FORMのフォームIDを入れる | |
add_action('mwform_before_send_admin_mail_mw-wp-form-xxx', function ($Mail_admin, $Data) { | |
add_filter('wp_mail', function($param) use ($Data){ | |
$data = $Data->gets(); | |
if(isset($param['to'])){ | |
//管理者と閲覧者でReply-To設定を分けたい場合はメールアドレスの文字列で判定 | |
//下記はサンプルでtoに含まれるドメインで判定 | |
preg_match('/mydomain\.jp/', $param['to'],$match); | |
if(count($match) > 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
<?php | |
add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' ); | |
function custom_upload_filter( $file ){ | |
if('csv' == substr($file['name'], strrpos($file['name'], '.') + 1)){ | |
$file['type'] = 'text/csv'; | |
} | |
if($file['type'] == 'text/csv' && mime_content_type($file['tmp_name']) == 'text/plain'){ | |
add_filter('upload_mimes', function($existing_mimes){ | |
$existing_mimes['csv'] = 'text/plain'; |
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 | |
class hytInsertMockPosts { | |
public function __construct($post_type = 'post',$taxonomies = ['category'],$num = 10){ | |
$this->post_type = $post_type; | |
$this->taxonomies = $taxonomies; | |
$this->num = $num; | |
} | |
public function mbRange($start, $end){ | |
if ($start == $end) { | |
return array($start); |
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
url: {http://xxx.com} | |
user: {admin_user} | |
color: false | |
core download: | |
locale: ja | |
version: latest | |
core config: | |
dbuser: {dbuser} | |
dbpass: {dbpass} |
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
<div class="entry-inner"><p>画像の配置テストへようこそ ! 画像をいろいろな位置に配置してみるのに一番良い方法は、言葉の海の中に画像をそっとうずめてみることです。さあ、はじめましょう。</p> | |
<p>画像の配置では、ユーザーが「指定なし」「右寄せ」「左寄せ」「中央揃え」の中から自分の好きなものを選べるようにする必要があります。さらに、「サムネイル」「中サイズ」「大サイズ」「フルサイズ」という選択肢の中から大きさを選べるようにするべきです。</p> | |
<p style="text-align: center;"><img class="size-full wp-image-906 aligncenter" title="画像配置 580x300" alt="画像配置 580x300" src="https://wpthemetestdata.files.wordpress.com/2013/03/image-alignment-580x300.jpg" width="580" height="300"></p> | |
<p>上記の画像は<strong>中央寄せ</strong>になるはずです。</p> | |
<p><strong><img class="size-full wp-image-904 alignleft" title="画像配置 150x150" alt="画像配置 150x150" src="https://wpthemetestdata.files.wordpress.com/2013/03/image-alignment-150x150.jpg" width="150" height="150"></strong>このパラグラフの残り画像を左寄せしたとき、文章が150ピクセルの画像の周りを囲むようになるかどうか見るためのものです。<strong></strong></p> | |
<p>ご覧のとおり、画像の上・下・右にスペースが空いている事がわかると思います。テキストは画像にこっそりと忍びよってはいません、忍び寄ることは良くない事です。画像だって十分に呼吸ができるスペースが必要なのです。画像が文章にイライラさせられることなく役割を果たせるようにしてあげてください。次の文章では、テキストが画像の右から下へとシームレスに途切れることなく続いている事がわかりますね。これで完了です !</p> | |
< |
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
<p>タイトルに特殊記号を含めた場合にも、レイアウトや機能に悪影響が出ないようにする必要があります。</p> | |
<p>投稿タイトル内の特殊記号は minify された JavaScript を使用している際に問題を引き起こす場合があることが確認されています。特に管理画面での投稿編集に影響が出やすいので注意しましょう (例: メタ・ボックス、メディアアップロードなど) 。</p> | |
<h2>ラテン文字テスト</h2> | |
<p>これは、テーマで使われているフォントで基本的なラテン文字が表示できるかどうかのテストです。</p> | |
<table> | |
<tbody> | |
<tr> | |
<td>!</td> | |
<td>“</td> | |
<td>#</td> |