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
/** | |
* スラッグからIDを取得して子ページを取得する。 | |
*/ | |
<?php | |
$parentPage = get_page_by_path('example'); | |
$parentId = $parentPage->ID; | |
?> | |
<ul> | |
<?php $lastposts = get_posts('post_type=page&posts_per_page=5&post_parent=' . $parentId); ?> | |
<?php foreach($lastposts as $post) : setup_postdata($post); ?> |
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
if(!(navigator.userAgent.indexOf("Safari") > 0 || navigator.userAgent.indexOf("Chrome") > 0)) { | |
// Safari and Chrome | |
} | |
if(!(navigator.userAgent.indexOf("Safari") > 0 || navigator.userAgent.indexOf("Chrome") > <0)) { | |
// Safari and not Chrome | |
} | |
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
<?php | |
/** | |
* HTMLエンティティへエンコード(エスケープ)及びデコード | |
*/ | |
class EscapeUtility { | |
/** | |
* 文字列をHTMLエスケープする | |
* | |
* @param string $string エスケープする文字列 |
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
d/* | |
* ディレクトリ削除 | |
* | |
* 中身のファイルを削除してからディレクトリを削除する。 | |
* | |
* @param $dir 削除するディレクトリ。末尾/はなし | |
* @return bool ディレクトリ削除に成功したらtrue, 失敗はfalse | |
*/ | |
function removeDirectory($dir) | |
{ |
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
The MIT License (MIT) | |
Copyright (c) 2016 Hiroshi Sawai | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Validation Test</title> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.10.0.css" media="all"> | |
</head> | |
<body> | |
<div id="qunit"></div> | |
<script src="http://code.jquery.com/qunit/qunit-1.10.0.js"></script> |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>キャンバス画像の回転サンプル</title> | |
<link rel="stylesheet" href="bootstrap.min.css" media="all"> | |
<link rel="stylesheet" href="bootstrap-responsive.min.css" media="all"> | |
<link rel="stylesheet" href="rotate.css" media="all"> | |
<script src="jquery-1.8.2.min.js"></script> |
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
jQuery(function($) { | |
// body部パラメーター | |
var data = {}; | |
// Canvasのデータをbase64でエンコードした文字列を取得 | |
var canvasData = $('canvas').get(0).toDataURL(); | |
// 不要な情報を取り除く | |
canvasData = canvasData.replace(/^data:image\/png;base64,/, ''); |
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
$catObj = new Category($post->ID); | |
$parentList = $catObj->getParentList(); | |
$childList = $catObj->getChildList(); | |
$childTree = $catObj->getChildTree(); |
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
<?php | |
/** | |
* 子孫カテゴリー表示ウィジェット | |
* @author Sawai Hiroshi | |
*/ | |
class DescendantCategoryWidget extends WP_Widget { | |
/** constructor */ | |
function DescendantCategoryWidget() { | |
parent::WP_Widget(false, $name = 'DescendantCategoryWidget'); | |
} |