Skip to content

Instantly share code, notes, and snippets.

@h2ospace
h2ospace / file0.php
Created August 24, 2017 15:57
All in One SEO Packの title, descriptionをプログラムで書き換える ref: http://qiita.com/seltzer/items/88f8e90accdaff3937d6
add_filter( 'aioseop_title', 'aioseop_title_func' );
function aioseop_title_func( $title ) {
$title = 'new title';
return $title;
}
@h2ospace
h2ospace / file0.php
Last active August 12, 2017 03:13
PHPで XMLパースの際に「@」から始まる属性を取得する ref: http://qiita.com/seltzer/items/91846d56750e1981704d
$xml = simplexml_load_file('http://example.com/atom.xml');
@h2ospace
h2ospace / file0.php
Created July 31, 2017 12:57
WordPressで、○ページ目のリンクURLを取得する ref: http://qiita.com/seltzer/items/6933897e02906cd2ec2b
$url = get_pagenum_link(3); // /category/cat1/page/3 などを取得
@h2ospace
h2ospace / file0.php
Created July 12, 2017 01:25
WordPressに Webhookの受信窓口を作る ref: http://qiita.com/seltzer/items/61f73b170ab68148cdb5
add_action('wp_ajax_hoge', 'hoge');
add_action('wp_ajax_nopriv_hoge', 'hoge');
function hoge() {
// ここに処理を書く
}
@h2ospace
h2ospace / file0.js
Created May 6, 2017 12:33
Electronで、前面に表示されているウィンドウを制御する ref: http://qiita.com/seltzer/items/258d579b50d3a99e5bb7
// ウィンドウなどを制御できるように remoteを取得
const remote = require('electron').remote;
// 現在フォーカスがあたっているウィンドウを取得
var win = remote.BrowserWindow.getFocusedWindow();
@h2ospace
h2ospace / file0.txt
Created April 13, 2017 23:01
gem installで『read server certificate B: certificate verify failed』と表示された時の対処法 ref: http://qiita.com/seltzer/items/13ef036f7736bc5a6d2a
read server certificate B: certificate verify failed
@h2ospace
h2ospace / file0.php
Created April 11, 2017 22:06
WordPressのフロントページに設定したページのIDを取得 ref: http://qiita.com/seltzer/items/28bb2f6e1318261117d1
$page = get_page_by_path('company'); // スラッグが companyの固定ページを取得
@h2ospace
h2ospace / file0.txt
Created March 27, 2017 03:36
WordPressの the_timeで表記を英語にする方法 ref: http://qiita.com/seltzer/items/08899e3cc23dd548cc0e
March 27th, 2017
@h2ospace
h2ospace / file0.txt
Last active March 15, 2017 09:37
PhpStormで選択した文字列をクオートで囲む ref: http://qiita.com/seltzer/items/7f8d623fa2597d153fa1
abc
@h2ospace
h2ospace / file0.php
Last active February 27, 2018 05:08
kintoneに添付した画像ファイルを PHPで表示する ref: http://qiita.com/seltzer/items/0df6c8b8290922474a45
<?php
define("API_TOKEN", "");
define("SUB_DOMAIN", "");
define("APP_NO", "");
//サーバ送信するHTTPヘッダを設定
$context = stream_context_create(array (
'http'=>array(
'method'=>'GET',
'header'=> "X-Cybozu-API-Token:". API_TOKEN ."\r\n"