Compare commits
3 Commits
187f1af050
..
VER1.0
| Author | SHA1 | Date | |
|---|---|---|---|
| da6cc8f734 | |||
| 60192377db | |||
| d7826ef2be |
+8
-14
@@ -39,17 +39,6 @@ if (!class_exists('MTEE')) {
|
||||
require_once MTEE_TEMPLATE_DIR . 'index.php';
|
||||
}
|
||||
|
||||
public function pages_setting() {
|
||||
//$_POST['_mtee'])があったら保存
|
||||
if (isset($_POST['_mtee'])) {
|
||||
check_admin_referer('check_options');
|
||||
$opt = $_POST['_mtee'];
|
||||
update_option('_mtee', $opt);
|
||||
require_once MTEE_TEMPLATE_DIR . 'success.php';
|
||||
}
|
||||
require_once MTEE_TEMPLATE_DIR . 'pages.php';
|
||||
}
|
||||
|
||||
public static function register_target(): array {
|
||||
$custom_posts = get_post_types(array('public' => true, '_builtin' => false));
|
||||
$taxonomies = get_taxonomies(array('public' => true, '_builtin' => false));
|
||||
@@ -92,9 +81,14 @@ if (!class_exists('MTEE')) {
|
||||
|
||||
public function get_ogp_img($type, $subtype = '') {
|
||||
if (empty($subtype)) {
|
||||
$id = get_option('_mtee')[$type]['ogp_img'];
|
||||
} else {
|
||||
$id = get_option('_mtee')[$type][$subtype]['ogp_img'];
|
||||
if (isset(get_option('_mtee')[$type]['ogp_img'])) {
|
||||
$id = get_option('_mtee')[$type]['ogp_img'];
|
||||
}
|
||||
}
|
||||
if (!empty($subtype)) {
|
||||
if (isset(get_option('_mtee')[$type][$subtype]['ogp_img'])) {
|
||||
$id = get_option('_mtee')[$type][$subtype]['ogp_img'];
|
||||
}
|
||||
}
|
||||
if (!empty($id)) {
|
||||
return '<img src="' . wp_get_attachment_image_src($id, 'thumbnail')[0] . '">';
|
||||
|
||||
@@ -10,12 +10,12 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
|
||||
use mtee_meta_desc_trait;
|
||||
|
||||
public $site_name;
|
||||
public $ogp_type;
|
||||
public $ogp_description;
|
||||
public $ogp_title;
|
||||
public $ogp_url;
|
||||
public $ogp_img;
|
||||
public $site_name = '';
|
||||
public $ogp_type = '';
|
||||
public $ogp_description = '';
|
||||
public $ogp_title = '';
|
||||
public $ogp_url = '';
|
||||
public $ogp_img = '';
|
||||
|
||||
public function __construct() {
|
||||
$this->site_name = get_bloginfo('name');
|
||||
@@ -53,7 +53,9 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
$tags .= '<meta property="og:description" content="' . $this->ogp_description . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:type" content="' . $this->ogp_type . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:url" content="' . $this->ogp_url . '" />' . PHP_EOL;
|
||||
// $tags .= '<meta property="og:image" content="' . $this->ogp_img . '" />' . PHP_EOL;
|
||||
if (!empty($this->ogp_img)) {
|
||||
$tags .= '<meta property="og:image" content="' . $this->ogp_img . '" />' . PHP_EOL;
|
||||
}
|
||||
$tags .= '<meta property="og:site_name" content="' . $this->site_name . '" />' . PHP_EOL;
|
||||
// $tags .= '<meta name="twitter:card" content="summary_large_image" />' . PHP_EOL;
|
||||
// $tags .= '<meta name="twitter:site" content="ツイッターのアカウント名" />' . PHP_EOL;
|
||||
@@ -80,6 +82,24 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
}
|
||||
|
||||
public function create_ogp_title() {
|
||||
global $post;
|
||||
if (is_home() || is_front_page()) {
|
||||
$this->ogp_title = get_option('_mtee')['top_page']['ogp_title'];
|
||||
} elseif (is_post_type_archive()) {
|
||||
$custom_post_name = get_post_type_object(get_post_type())->name;
|
||||
$this->ogp_title = get_option('_mtee')['custom_post'][$custom_post_name]['ogp_title'];
|
||||
} elseif (is_category() || is_tag() || is_tax()) {
|
||||
$queried_object = get_queried_object();
|
||||
$this->ogp_title = get_term_meta($queried_object->term_id, MTEE_OGP_TITLE, true);
|
||||
} elseif (is_page() || is_single()) {
|
||||
$this->ogp_title = get_post_meta($post->ID, MTEE_OGP_TITLE, true);
|
||||
}
|
||||
if (empty($this->ogp_title)) {
|
||||
$this->create_default_title();
|
||||
}
|
||||
}
|
||||
|
||||
public function create_default_title() {
|
||||
if (is_category()) {
|
||||
$this->ogp_title = single_cat_title('', false);
|
||||
} elseif (is_tag()) {
|
||||
@@ -96,11 +116,29 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
}
|
||||
|
||||
public function create_ogp_description() {
|
||||
$this->ogp_description = $this->site_name . MTEE_META_DESC_PARTICLE;
|
||||
$this->ogp_description .= $this->set_ogp_description();
|
||||
$this->create_input_description();
|
||||
if (empty($this->ogp_description)) {
|
||||
$this->set_default_description();
|
||||
}
|
||||
}
|
||||
|
||||
public function set_ogp_description() {
|
||||
public function create_input_description() {
|
||||
global $post;
|
||||
if (is_home() || is_front_page()) {
|
||||
$this->ogp_description = get_option('_mtee')['top_page']['ogp_description'];
|
||||
} elseif (is_post_type_archive()) {
|
||||
$custom_post_name = get_post_type_object(get_post_type())->name;
|
||||
$this->ogp_description = get_option('_mtee')['custom_post'][$custom_post_name]['ogp_description'];
|
||||
} elseif (is_category() || is_tag() || is_tax()) {
|
||||
$queried_object = get_queried_object();
|
||||
$this->ogp_description = get_term_meta($queried_object->term_id, MTEE_OGP_DESC, true);
|
||||
} elseif (is_page() || is_single()) {
|
||||
$this->ogp_description = get_post_meta($post->ID, MTEE_OGP_DESC, true);
|
||||
}
|
||||
}
|
||||
|
||||
public function set_default_description() {
|
||||
$this->ogp_description = $this->site_name . MTEE_META_DESC_PARTICLE;
|
||||
$type = '';
|
||||
$ogp_desc = '';
|
||||
|
||||
@@ -126,13 +164,12 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
}
|
||||
|
||||
if (!empty($type)) {
|
||||
$ogp_desc = $this->post_output_get_meta_desc($type);
|
||||
$this->ogp_description .= $this->post_output_get_meta_desc($type);
|
||||
}
|
||||
|
||||
if (empty($ogp_desc)) {
|
||||
$ogp_desc = $this->create_default_description();
|
||||
$this->ogp_description .= $this->create_default_description();
|
||||
}
|
||||
return $ogp_desc;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,81 +197,59 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
|
||||
public function create_ogp_image() {
|
||||
global $post;
|
||||
$id = '';
|
||||
$type = '';
|
||||
if (is_post_type_archive()) {
|
||||
$type = 'custom_post_archive';
|
||||
$this->set_custom_post_archive_ogp_img();
|
||||
} elseif (is_category()) {
|
||||
$id = get_query_var('cat');
|
||||
$type = 'cat';
|
||||
$this->set_category_ogp_img(get_query_var('cat'));
|
||||
} elseif (is_tag()) {
|
||||
$id = get_query_var('tag_id');
|
||||
$type = 'tag';
|
||||
$this->set_tag_ogp_img(get_query_var('tag_id'));
|
||||
} elseif (is_tax()) {
|
||||
$id = get_queried_object()->term_id;
|
||||
$type = 'tax';
|
||||
$this->set_tax_ogp_img(get_queried_object()->term_id);
|
||||
} elseif (is_home() || is_front_page()) {
|
||||
$type = 'top_page';
|
||||
$this->set_top_page_ogp_img();
|
||||
} elseif (is_page() || is_single()) {
|
||||
$id = $post->ID;
|
||||
$type = 'posts';
|
||||
}
|
||||
return $this->get_ogp_tag_img($id, $type);
|
||||
}
|
||||
|
||||
public function get_ogp_tag_img($id, $type) {
|
||||
if ($type == 'top_page') {
|
||||
$canonical = $this->set_top_page_ogp_img();
|
||||
} elseif ($type == 'custom_post_archive') {
|
||||
$canonical = $this->set_custom_post_archive_ogp_img();
|
||||
} elseif ($type == 'posts') {
|
||||
$canonical = $this->set_post_ogp_img($id);
|
||||
} elseif ($type == 'cat') {
|
||||
$canonical = $this->set_category_ogp_img($id);
|
||||
} elseif ($type == 'tag') {
|
||||
$canonical = $this->set_tag_ogp_img($id);
|
||||
} elseif ($type == 'tax') {
|
||||
$canonical = $this->set_tax_ogp_img($id);
|
||||
$this->set_post_ogp_img($post->ID);
|
||||
}
|
||||
}
|
||||
|
||||
public function set_top_page_ogp_img() {
|
||||
$img = get_option('_mtee')['top_page']['ogp_img'];
|
||||
if (empty($img)) {
|
||||
$img = '';
|
||||
}
|
||||
return $img;
|
||||
$id = get_option('_mtee')['top_page']['ogp_img'];
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function set_custom_post_archive_ogp_img() {
|
||||
$custom_post_name = get_post_type_object(get_post_type())->name;
|
||||
$img = get_option('_mtee')['custom_post'][$custom_post_name]['ogp_img'];
|
||||
if (empty($img)) {
|
||||
$img = '';
|
||||
}
|
||||
return $img;
|
||||
$id = get_option('_mtee')['custom_post'][$custom_post_name]['ogp_img'];
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function set_post_ogp_img($id) {
|
||||
$img = get_post_meta($id, MTEE_OGP_IMG, true);
|
||||
|
||||
$id = get_post_meta($id, MTEE_OGP_IMG, true);
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function set_category_ogp_img($id) {
|
||||
$img = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
|
||||
$id = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function set_tag_ogp_img($id) {
|
||||
$img = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
|
||||
$id = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function set_tax_ogp_img($id) {
|
||||
$img = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
|
||||
$id = get_term_meta($id, MTEE_OGP_IMG, true);
|
||||
$this->get_thumbnail($id);
|
||||
}
|
||||
|
||||
public function get_thumbnail($id) {
|
||||
if (!empty($id)) {
|
||||
$this->ogp_img = wp_get_attachment_url($id);
|
||||
} elseif (has_post_thumbnail($id)) {
|
||||
$this->ogp_img = wp_get_attachment_url(get_post_thumbnail_id($id));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+28
-9
@@ -6,15 +6,34 @@ jQuery(function ($) {
|
||||
function nab_menu() {
|
||||
let menu_list = $('.mtee_tab_menu li');
|
||||
let content_box = $('.mtee_tab_box');
|
||||
menu_list.on('click', function () {
|
||||
if (!$(this).hasClass('en')) {
|
||||
let index = $(this).index();
|
||||
$('.mtee_tab_menu li').removeClass('en');
|
||||
$(this).addClass('en');
|
||||
content_box.hide();
|
||||
$('.mtee_tab_box:eq(' + index + ')').show();
|
||||
}
|
||||
});
|
||||
|
||||
init();
|
||||
click_menu();
|
||||
|
||||
function init() {
|
||||
let current_nav = $('#mtee_set_nav').val();
|
||||
let current_index = menu_list.index($('#' + current_nav));
|
||||
|
||||
$('.mtee_tab_menu li').removeClass('en');
|
||||
$('#' + current_nav).addClass('en');
|
||||
|
||||
content_box.hide();
|
||||
$('.mtee_tab_box:eq(' + current_index + ')').show();
|
||||
}
|
||||
|
||||
function click_menu() {
|
||||
menu_list.on('click', function () {
|
||||
if (!$(this).hasClass('en')) {
|
||||
let index = $(this).index();
|
||||
$('.mtee_tab_menu li').removeClass('en');
|
||||
$(this).addClass('en');
|
||||
content_box.hide();
|
||||
$('#mtee_set_nav').val($(this).attr('id'));
|
||||
$('.mtee_tab_box:eq(' + index + ')').show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-2
@@ -8,7 +8,13 @@ Version: 1.0
|
||||
|
||||
/*
|
||||
Todo:OGPタグ
|
||||
タグの出力
|
||||
画像出力
|
||||
|
||||
facebook
|
||||
<meta property="fb:app_id" content="[FacebookアプリのID]" />
|
||||
|
||||
Twitter
|
||||
|
||||
*/
|
||||
|
||||
include_once 'config.php';
|
||||
@@ -19,7 +25,9 @@ add_action('admin_enqueue_scripts', function () {
|
||||
$plugin_url = plugin_dir_url(__FILE__);
|
||||
wp_enqueue_style('mtee_style', $plugin_url . 'css/mtee.css');
|
||||
wp_enqueue_script('mtee_js', $plugin_url . 'js/mtee.js', 'jquery');
|
||||
wp_enqueue_media(); //メディアアップローダーのためのスクリプト読み込み
|
||||
//メディアアップローダー
|
||||
wp_enqueue_media();
|
||||
|
||||
});
|
||||
|
||||
$mtee = new MTEE;
|
||||
|
||||
+46
-205
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$register_targets = MTEE::register_target();
|
||||
$opt = get_option('_mtee');
|
||||
$mtee_set_nav = $_POST['mtee_set_nav'] ?? 'nav_metas';
|
||||
$enabled = $this->get_key_setting('enabled');
|
||||
$noindex_nofollow = $this->get_key_setting('noindex_nofollow');
|
||||
$ogp_setting = $this->get_key_setting('ogp_setting');
|
||||
@@ -14,34 +15,27 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<h2>meta keyword, description / バージョン情報 設定</h2>
|
||||
<nav class="mtee_tab_menu">
|
||||
<ul>
|
||||
<li class="en">全体設定</li>
|
||||
<li>ページ設定</li>
|
||||
<li id="nav_metas" class="en">メタキーワード・ディスクリプション</li>
|
||||
<li id="nav_ogp">OGP</li>
|
||||
<li id="nav_noindex">noindex/nofollow</li>
|
||||
<li id="nav_canonical">Canonical</li>
|
||||
<li id="nav_version">バージョン情報等</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<form action="" method="post">
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<input type="hidden" id="mtee_set_nav" name="mtee_set_nav" value="<?php echo $mtee_set_nav; ?>">
|
||||
<div class="mtee_tab_box">
|
||||
<div class="mtee-form-box">
|
||||
<h2>メタキーワード・ディスクリプション/OGP</h2>
|
||||
<h2>メタキーワード・ディスクリプション</h2>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[enabled]" value="0">
|
||||
<input type="checkbox" name="_mtee[enabled]" <?php checked($enabled, 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
<h3>OGP出力</h3>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[ogp_setting]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[ogp_setting]" <?php checked($ogp_setting, 1); ?>
|
||||
value="1">有効(og:descriptionはmeta descriptionと同じ設定になります)
|
||||
</label>
|
||||
</div>
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>meta keywords テンプレート設定
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?>
|
||||
</h3>
|
||||
<h3>meta keywords テンプレート設定</h3>
|
||||
<p>個別設定していない投稿やカテゴリー等は、このテンプレートを適用します。</p>
|
||||
<?php
|
||||
$post_meta_keywords_tmp = get_option('_mtee')['keywords_tmp']['post'] ?? '';
|
||||
@@ -100,10 +94,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>meta description テンプレート設定
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></h3>
|
||||
<h3>meta description テンプレート設定</h3>
|
||||
<p>個別設定していない投稿やカテゴリー等は、このテンプレートを適用します。</p>
|
||||
<?php
|
||||
$page_meta_desc_tmp = get_option('_mtee')['description_tmp']['page'] ?? '';
|
||||
@@ -143,15 +134,47 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<li>##title##:投稿、ページ、カテゴリー等のタイトル</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>個別設定 NOINDEX/NOFOLLOW</h3>
|
||||
<?php include 'pages_meta.php'; ?>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
</div>
|
||||
<div class="mtee_tab_box">
|
||||
<div class="mtee-form-box">
|
||||
<h2>OGP</h2>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[noindex_nofollow]" value="0">
|
||||
<input type="hidden" name="_mtee[ogp_setting]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[noindex_nofollow]" <?php checked($noindex_nofollow, 1); ?>
|
||||
name="_mtee[ogp_setting]" <?php checked($ogp_setting, 1); ?>
|
||||
value="1">有効(デフォルトのog:descriptionはmeta descriptionになります)
|
||||
</label>
|
||||
</div>
|
||||
<?php include 'pages_ogp.php'; ?>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
</div>
|
||||
<div class="mtee_tab_box">
|
||||
<h2>noindex/nofollow</h2>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[noindex_nofollow]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[noindex_nofollow]" <?php checked($noindex_nofollow, 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
<?php include 'pages_noindexnofollow.php'; ?>
|
||||
</div>
|
||||
<div class="mtee_tab_box">
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>Canonical URL 出力</h3>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[canonical_setting]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[canonical_setting]" <?php checked($canonical_setting, 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
</div>
|
||||
<?php include 'pages_canonical.php'; ?>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
</div>
|
||||
<div class="mtee_tab_box">
|
||||
<h2>バージョン情報等</h2>
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>RSS</h3>
|
||||
<label>
|
||||
@@ -199,188 +222,6 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
</div>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
</div>
|
||||
<div class="mtee_tab_box">
|
||||
<h2 class="mtee_page_title">トップページ</h2>
|
||||
<?php
|
||||
$keywords = $opt['top_page']['keywords'] ?? '';
|
||||
$description = $opt['top_page']['description'] ?? '';
|
||||
$noindex = $opt['top_page']['noindex'] ?? '0';
|
||||
$nofollow = $opt['top_page']['nofollow'] ?? '0';
|
||||
$canonical_url = $opt['top_page']['canonical'] ?? '';
|
||||
$ogp_img = $opt['top_page']['ogp_img'] ?? '';
|
||||
?>
|
||||
<div class="mtee-form-box">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>meta keywords
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td><input class="top_page_keywords" type="text" name="_mtee[top_page][keywords]"
|
||||
value="<?php echo $keywords; ?>" placeholder="キーワード1,キーワード2,キーワード3">
|
||||
<br>キーワードはカンマ(,)区切りで入力してください
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>meta description
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td><input class="top_page_description" type="text" name="_mtee[top_page][description]"
|
||||
value="<?php echo $description; ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の<?php echo MTEE_META_DESC_TOP_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>noindex nofollow
|
||||
<?php if (!$this->is_enable('noindex_nofollow')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?>
|
||||
</th>
|
||||
<td>
|
||||
<div class="meta_noindex_nofollow_box">
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[top_page][noindex]" value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[top_page][noindex]" <?php checked($noindex, 1); ?>
|
||||
value="1"/>
|
||||
noindex
|
||||
</label>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[top_page][nofollow]" value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[top_page][nofollow]" <?php checked($nofollow, 1); ?>
|
||||
value="1"/>
|
||||
nofollow
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>Canonical URL
|
||||
<?php if (!$this->is_enable('canonical_setting')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[top_page][canonical]"
|
||||
value="<?php echo $canonical_url; ?>"
|
||||
placeholder="<?php echo get_bloginfo('url'); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_OGP_IMG; ?>" name="_mtee[top_page][ogp_img]" type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
<input type="button" class="select_ogp_img" name="select_ogp_img" value="選択"/>
|
||||
<input type="button" class="clear_ogp_img" name="clear_ogp_img" value="クリア"/>
|
||||
<div class="ogp_media"><?php echo $this->get_ogp_img('top_page'); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (count($register_targets['custom_posts']) > 0): ?>
|
||||
<h2 class="mtee_page_title">カスタム投稿アーカイブ</h2>
|
||||
<?php foreach ($register_targets['custom_posts'] as $custom_post): ?>
|
||||
<?php
|
||||
$keywords = $opt['custom_post'][$custom_post]['keywords'] ?? '';
|
||||
$description = $opt['custom_post'][$custom_post]['description'] ?? '';
|
||||
$noindex = $opt['custom_post'][$custom_post]['noindex'] ?? '0';
|
||||
$nofollow = $opt['custom_post'][$custom_post]['nofollow'] ?? '0';
|
||||
$canonical_url = $opt['custom_post'][$custom_post]['canonical'] ?? '0';
|
||||
$ogp_img = $opt['custom_post'][$custom_post]['ogp_img'] ?? '0';
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
<?php echo get_post_type_object($custom_post)->label; ?>
|
||||
(<?php echo $custom_post; ?>)
|
||||
</h3>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>meta keywords
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></th>
|
||||
<td><input class="top_page_keywords" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][keywords]"
|
||||
value="<?php echo $keywords; ?>" placeholder="キーワード1,キーワード2,キーワード3">
|
||||
<br>キーワードはカンマ(,)区切りで入力してください
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>meta description
|
||||
<?php if (!$this->is_enable('enabled')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][description]"
|
||||
value="<?php echo $description; ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の[カスタム投稿ラベル]<?php echo MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>noindex nofollow
|
||||
<?php if (!$this->is_enable('noindex_nofollow')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></th>
|
||||
<td>
|
||||
<div class="meta_noindex_nofollow_box">
|
||||
<label>
|
||||
<input type="hidden"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][noindex]"
|
||||
value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][noindex]" <?php checked($noindex, 1); ?>
|
||||
value="1"/>
|
||||
noindex
|
||||
</label>
|
||||
<label>
|
||||
<input type="hidden"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][nofollow]"
|
||||
value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][nofollow]" <?php checked($nofollow, 1); ?>
|
||||
value="1"/>
|
||||
nofollow
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>Canonical URL
|
||||
<?php if (!$this->is_enable('canonical_setting')): ?>
|
||||
<span class="disabled_status">※現在無効です</span>
|
||||
<?php endif; ?></th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][canonical]"
|
||||
value="<?php echo $canonical_url; ?>"
|
||||
placeholder="<?php echo get_post_type_archive_link($custom_post); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_OGP_IMG; ?>"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][ogp_img]"
|
||||
type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
<input type="button" class="select_ogp_img" name="select_ogp_img" value="選択"/>
|
||||
<input type="button" class="clear_ogp_img" name="clear_ogp_img" value="クリア"/>
|
||||
<div class="ogp_media"><?php echo $this->get_ogp_img('custom_post', $custom_post); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
<script>
|
||||
var ogp_img_name = "<?php echo MTEE_OGP_IMG; ?>"
|
||||
</script>
|
||||
</div>
|
||||
</form>
|
||||
<!-- /.wrap -->
|
||||
</div>
|
||||
@@ -0,0 +1,42 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$canonical_url = $opt['top_page']['canonical'] ?? '';
|
||||
?>
|
||||
<div class="mtee-form-box">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>Canonical URL</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[top_page][canonical]"
|
||||
value="<?php echo $canonical_url; ?>"
|
||||
placeholder="<?php echo get_bloginfo('url'); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (count($register_targets['custom_posts']) > 0): ?>
|
||||
<h2 class="mtee_page_title">カスタム投稿アーカイブ</h2>
|
||||
<?php foreach ($register_targets['custom_posts'] as $custom_post): ?>
|
||||
<?php
|
||||
$canonical_url = $opt['custom_post'][$custom_post]['canonical'] ?? '';
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
<?php echo get_post_type_object($custom_post)->label; ?>
|
||||
(<?php echo $custom_post; ?>)
|
||||
</h3>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>Canonical URL</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][canonical]"
|
||||
value="<?php echo $canonical_url; ?>"
|
||||
placeholder="<?php echo get_post_type_archive_link($custom_post); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$keywords = $opt['top_page']['keywords'] ?? '';
|
||||
$description = $opt['top_page']['description'] ?? '';
|
||||
?>
|
||||
<div class="mtee-form-box">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>meta keywords</th>
|
||||
<td><input class="top_page_keywords" type="text" name="_mtee[top_page][keywords]"
|
||||
value="<?php echo $keywords; ?>" placeholder="キーワード1,キーワード2,キーワード3">
|
||||
<br>キーワードはカンマ(,)区切りで入力してください
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>meta description</th>
|
||||
<td><input class="top_page_description" type="text" name="_mtee[top_page][description]"
|
||||
value="<?php echo $description; ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の<?php echo MTEE_META_DESC_TOP_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (count($register_targets['custom_posts']) > 0): ?>
|
||||
<h2 class="mtee_page_title">カスタム投稿アーカイブ</h2>
|
||||
<?php foreach ($register_targets['custom_posts'] as $custom_post): ?>
|
||||
<?php
|
||||
$keywords = $opt['custom_post'][$custom_post]['keywords'] ?? '';
|
||||
$description = $opt['custom_post'][$custom_post]['description'] ?? '';
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
<?php echo get_post_type_object($custom_post)->label; ?>
|
||||
(<?php echo $custom_post; ?>)
|
||||
</h3>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>meta keywords</th>
|
||||
<td><input class="top_page_keywords" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][keywords]"
|
||||
value="<?php echo $keywords; ?>" placeholder="キーワード1,キーワード2,キーワード3">
|
||||
<br>キーワードはカンマ(,)区切りで入力してください
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>meta description</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][description]"
|
||||
value="<?php echo $description; ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の[カスタム投稿ラベル]<?php echo MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$noindex = $opt['top_page']['noindex'] ?? '0';
|
||||
$nofollow = $opt['top_page']['nofollow'] ?? '0';
|
||||
?>
|
||||
<div class="mtee-form-box">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>noindex nofollow</th>
|
||||
<td>
|
||||
<div class="meta_noindex_nofollow_box">
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[top_page][noindex]" value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[top_page][noindex]" <?php checked($noindex, 1); ?>
|
||||
value="1"/>
|
||||
noindex
|
||||
</label>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[top_page][nofollow]" value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[top_page][nofollow]" <?php checked($nofollow, 1); ?>
|
||||
value="1"/>
|
||||
nofollow
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (count($register_targets['custom_posts']) > 0): ?>
|
||||
<h2 class="mtee_page_title">カスタム投稿アーカイブ</h2>
|
||||
<?php foreach ($register_targets['custom_posts'] as $custom_post): ?>
|
||||
<?php
|
||||
$noindex = $opt['custom_post'][$custom_post]['noindex'] ?? '0';
|
||||
$nofollow = $opt['custom_post'][$custom_post]['nofollow'] ?? '0';
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
<?php echo get_post_type_object($custom_post)->label; ?>
|
||||
(<?php echo $custom_post; ?>)
|
||||
</h3>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>noindex nofollow</th>
|
||||
<td>
|
||||
<div class="meta_noindex_nofollow_box">
|
||||
<label>
|
||||
<input type="hidden"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][noindex]"
|
||||
value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][noindex]" <?php checked($noindex, 1); ?>
|
||||
value="1"/>
|
||||
noindex
|
||||
</label>
|
||||
<label>
|
||||
<input type="hidden"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][nofollow]"
|
||||
value="0"/>
|
||||
<input type="checkbox"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][nofollow]" <?php checked($nofollow, 1); ?>
|
||||
value="1"/>
|
||||
nofollow
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
|
||||
@@ -0,0 +1,81 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$ogp_title = $opt['top_page']['ogp_title'] ?? '';
|
||||
$ogp_description = $opt['top_page']['ogp_description'] ?? '';
|
||||
$ogp_img = $opt['top_page']['ogp_img'] ?? '';
|
||||
?>
|
||||
<div class="mtee-form-box">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>OGP title</th>
|
||||
<td><input class="top_page_keywords" type="text" name="_mtee[top_page][ogp_title]"
|
||||
value="<?php echo $ogp_title; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP description</th>
|
||||
<td><input class="top_page_description" type="text" name="_mtee[top_page][ogp_description]"
|
||||
value="<?php echo $ogp_description; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_OGP_IMG; ?>" name="_mtee[top_page][ogp_img]" type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
<input type="button" class="select_ogp_img" name="select_ogp_img" value="選択"/>
|
||||
<input type="button" class="clear_ogp_img" name="clear_ogp_img" value="クリア"/>
|
||||
<div class="ogp_media"><?php echo $this->get_ogp_img('top_page'); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php if (count($register_targets['custom_posts']) > 0): ?>
|
||||
<h2 class="mtee_page_title">カスタム投稿アーカイブ</h2>
|
||||
<?php foreach ($register_targets['custom_posts'] as $custom_post): ?>
|
||||
<?php
|
||||
$ogp_title = $opt['custom_post'][$custom_post]['ogp_title'] ?? '';
|
||||
$ogp_description = $opt['custom_post'][$custom_post]['ogp_description'] ?? '';
|
||||
$ogp_img = $opt['custom_post'][$custom_post]['ogp_img'] ?? '';
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
<?php echo get_post_type_object($custom_post)->label; ?>
|
||||
(<?php echo $custom_post; ?>)
|
||||
</h3>
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th>OGP title</th>
|
||||
<td><input class="top_page_keywords" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][ogp_title]"
|
||||
value="<?php echo $ogp_title; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP description</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][ogp_description]"
|
||||
value="<?php echo $ogp_description; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_OGP_IMG; ?>"
|
||||
name="_mtee[custom_post][<?php echo $custom_post; ?>][ogp_img]"
|
||||
type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
<input type="button" class="select_ogp_img" name="select_ogp_img" value="選択"/>
|
||||
<input type="button" class="clear_ogp_img" name="clear_ogp_img" value="クリア"/>
|
||||
<div class="ogp_media"><?php echo $this->get_ogp_img('custom_post', $custom_post); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<script>
|
||||
var ogp_img_name = "<?php echo MTEE_OGP_IMG; ?>"
|
||||
</script>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div class="updated fade"><p><strong>設定を保存しました</strong></p></div>
|
||||
<div id="settings_updated" class="updated notice is-dismissible"><p><strong>設定を保存しました</strong></p></div>
|
||||
|
||||
Reference in New Issue
Block a user