Skip to content

Instantly share code, notes, and snippets.

View huuyafwww's full-sized avatar

huuya huuyafwww

  • Tokyo, Japan
  • 08:20 (UTC +09:00)
View GitHub Profile
<script src="https://82mou.github.io/infobox/lib/infobox.js"></script>
var geocode_value = new google.maps.Geocoder().geocode({'address': "住所を入力"}, function(results, status) {
console.log(results[0].geometry.location);
});
var map_canvas = new google.maps.Map( document.getElementById("map"),{
gestureHandling: 'greedy',
});
var map_canvas = new google.maps.Map( document.getElementById("map"), {
mapTypeControl:false
});
define('WP_RANKINGER_PRO_PLUGIN_DIR',plugin_dir_path(__FILE__));
function wp_rankinger_pro_about() {
include(WP_RANKINGER_PRO_PLUGIN_DIR.'about.php');
}
function wp_rankinger_pro_ranking() {
include(WP_RANKINGER_PRO_PLUGIN_DIR.'ranking.php');
}
add_action('admin_menu','wp_rankinger_pro_admin');
function wp_rankinger_pro_admin() {
add_menu_page(
'Welcome WP Rankinger Pro',
'WP Rankinger Pro',
'administrator',
'about_pro',
'wp_rankinger_pro_about',
'dashicons-awards'
);
<?php
/*
Plugin Name:WP Rankinger Pro
Description:Wordrepssのどのテーマを利用していてもWP Rankinger Proを利用していれば、ランキングやコンバージョンボタン、テキストリンクを初心者の方でも視覚的にカスタマイズしてサイト上で利用することが出来ます。
Version:1.2.3
Author:Fwww
Author URI:https://fwww7.com
License: GPL2
*/
function text_ajax_test(){
check_ajax_referer('text_test_ajax','secure');
if(isset($_REQUEST['text_test'])){
//ここに処理を書く
}
}
add_action('wp_ajax_text_ajax_test','text_ajax_test');//ログインユーザーがactionする場合
add_action('wp_ajax_nopriv_text_ajax_test','text_ajax_test');//非ログインユーザーがactionする場合
$.ajax({
dataType: "text",
url: admin_ajax_url,
data: {
'action': 'array_ajax_test',
'array_test[]': array,
'secure': '<?php echo wp_create_nonce('array_test_ajax') ?>'
}
});
$.ajax({
dataType: "text",
url: admin_ajax_url,
data: {
'action': 'text_ajax_test',
'text_test': text,
'secure': '<?php echo wp_create_nonce('text_test_ajax ') ?>'
}
});