BASEのAPIの開発者向けのドキュメントです。
このAPIを使うと、あなたのアプリケーションとBASEを連携させることができます。
例えば
- BASEのアカウントでログインする
- BASEのショップの商品情報を取得する
<?php | |
define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
define('WYSIWYG_META_KEY', 'extra-content'); | |
add_action('admin_init', 'wysiwyg_register_meta_box'); | |
function wysiwyg_register_meta_box(){ | |
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
} |
<?php | |
/* | |
現在の日時から2日後のタイムスタンプを保存する | |
$d = 2 * 60 * 60 * 24; // 2日間 | |
$expire = current_time('timestamp', get_option("gmt_offset")) + $d; | |
update_post_meta($post->ID, '_expire', $expire); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Tournament Bracket Generator</title> | |
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script src="http://underscorejs.org/underscore-min.js"></script> | |
<script> | |
$(document).on('ready', function() { | |
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes) |
/** | |
* 指定サイズ以内の画像幅、高さを算出、 | |
* img要素にそのサイズを適用する | |
* | |
* 使い方: | |
* | |
* 例) 幅150px, 高さ200px以内で画像を表示する | |
* var img = document.createElement('img'); | |
* img.src = 'http://hoge.com/img/fuga.jpg'; | |
* imgResize.resize(img, 150, 200); |
server { | |
# (略) | |
location ~* /wp-login\.php|/wp-admin/((?!admin-ajax\.php).)*$ { | |
index index.php index.html index.htm; | |
# 許可するIPアドレスを記述 | |
allow 192.168.0.1; | |
deny all; | |
# Basic認証のメッセージ |
<?php | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
<?php | |
// check to see if there is a post type in the URL | |
if ( isset( $_GET['post_type'] ) && $_GET['post_type'] ) { | |
// save it for later | |
$post_type = $_GET['post_type']; | |
// check to see if a search template exists | |
if ( locate_template( 'search-' . $post_type . '.php' ) ) { |
<?php | |
function get_holidays_this_month($year, $month){ | |
// 月初日 | |
$first_day = mktime(0, 0, 0, intval($month), 1, intval($year)); | |
// 月末日 | |
$last_day = strtotime('-1 day', mktime(0, 0, 0, intval($month) + 1, 1, intval($year))); | |
$api_key = 'YOUR API KEY HERE'; | |
$holidays_id = 'outid3el0qkcrsuf89fltf7a4qbacgt9@import.calendar.google.com'; // mozilla.org版 |