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
AuthType Basic | |
AuthUserFile /*サーバーのパス*/.htpasswd | |
AuthGroupFile /dev/null | |
AuthName "Please enter your ID and password" | |
Require valid-user | |
<FilesMatch "(admin-ajax.php)$"> | |
Satisfy Any | |
Order allow,deny | |
Allow from all | |
Deny from none |
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
<Files wp-login.php> | |
AuthType Basic | |
AuthUserFile /*サーバーのパス*/.htpasswd | |
AuthGroupFile /dev/null | |
AuthName "Please enter your ID and password" | |
require valid-user | |
</Files> |
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
/* 参照・参考 | |
http://firegoby.jp/archives/2244 | |
http://www.rescuework.jp/blog/customfield-escape.html | |
*/ | |
// HTMLをエスケープ | |
esc_html($content); | |
// URLをエスケープ | |
esc_url($url); |
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 type="text/javascript"> | |
jQuery(document).ready(function(){ | |
// クッキーに投げる | |
jQuery.cookie('jsNotIn','値'); | |
// クッキーの値を受け取る | |
var notIn = jQuery.cookie('jsNotIn'); | |
console.log(notIn); | |
}); | |
</script> |
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
$subject = '<div id="pickId_4046"></div><div id="pickId_3077"></div><div class="888"></div>'; | |
$subject = esc_html(file_get_contents( site_url() )); | |
$not_in_array = ''; | |
$pattern = '/id="pickId_([0-9]+)"/'; | |
preg_match_all($pattern,$subject,$out, PREG_PATTERN_ORDER); | |
$not_in_array = $out[1]; // [0]はマッチした条件部分の配列 | |
print '<pre>';print_r($not_in_array);print '</pre>'; |
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 | |
/* | |
※もっとスマートな実装方法があれば教えてください。 | |
【1】 閲覧ユーザー用のIDを1つ発行 | |
予め | |
ID : member | |
パスワード : memberpass | |
のユーザーを購読者権限で発行 |
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
function term_parent_child( $taxonomy, $separator ) { | |
// タームの配列を取得 | |
$terms = get_the_terms( $post->ID, $taxonomy); | |
// print '<pre>';print_r($terms);print '</pre>'; | |
foreach ($terms as $term) { | |
if ($term->parent == 0) { | |
// parent が 0 のタームが先祖なのでIDを取得 | |
$parent_term_id = $term->term_id; | |
} else { | |
// 子のターム |
NewerOlder