WP PLUGIN MTEE(Meta Tag etc Extend) 表示変更

・設定項目毎のタブを分割
・トップページのmeta keywordsを復活
This commit is contained in:
2021-06-12 12:06:01 +09:00
parent d7826ef2be
commit 60192377db
6 changed files with 466 additions and 260 deletions
-11
View File
@@ -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));
+44 -249
View File
@@ -14,34 +14,26 @@ $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 class="en">メタキーワード・ディスクリプション</li>
<li>OGP</li>
<li>noindexnofollow</li>
<li>Canonical</li>
<li>バージョン情報等</li>
</ul>
</nav>
<form action="" method="post">
<?php wp_nonce_field('check_options'); ?>
<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 +92,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 +132,47 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
<li>##title##:投稿、ページ、カテゴリー等のタイトル</li>
</ul>
</div>
<div class="mtee-form-box mtee_box_border">
<h3>個別設定 NOINDEXNOFOLLOW</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>noindexnofollow</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,232 +220,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_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>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; ?>">
<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 title
<?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][ogp_title]"
value="<?php echo $ogp_title; ?>">
</td>
</tr>
<tr valign="top">
<th>OGP 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][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
$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'] ?? '';
$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>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 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; ?>][ogp_title]"
value="<?php echo $ogp_title; ?>">
</td>
</tr>
<tr valign="top">
<th>OGP 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; ?>][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; ?>
<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>
+42
View File
@@ -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; ?>
+74
View File
@@ -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>
+81
View File
@@ -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>
+225
View File
@@ -0,0 +1,225 @@
<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_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>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; ?>">
<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 title
<?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][ogp_title]"
value="<?php echo $ogp_title; ?>">
</td>
</tr>
<tr valign="top">
<th>OGP 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][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
$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'] ?? '';
$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>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 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; ?>][ogp_title]"
value="<?php echo $ogp_title; ?>">
</td>
</tr>
<tr valign="top">
<th>OGP 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; ?>][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; ?>
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
<script>
var ogp_img_name = "<?php echo MTEE_OGP_IMG; ?>"
</script>