WP PLUGIN MTEE(Meta Tag etc Extend) 表示のエスケープ
・echo時データのエスケープ処理追加
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ if (!class_exists('MTEE')) {
|
||||
}
|
||||
}
|
||||
if (!empty($id)) {
|
||||
return '<img src="' . wp_get_attachment_image_src($id, 'thumbnail')[0] . '">';
|
||||
return '<img src="' . esc_html(wp_get_attachment_image_src($id, 'thumbnail')[0]) . '">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,8 +124,8 @@ placeholder="' . $this->set_default_post_canonical_url($post->ID) . '" />
|
||||
if (isset($tag->term_id) && empty($canonical_url)) {
|
||||
$placeholder = $this->set_default_tax_canonical_url($tag->term_id, $tag->taxonomy);
|
||||
}
|
||||
$add_meta = '<input type="text" name="' . MTEE_CONFIG::MTEE_CANONICAL_URL . '" value="' . $canonical_url . '"
|
||||
placeholder="' . $placeholder . '" />';
|
||||
$add_meta = '<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_CANONICAL_URL) . '" value="' . esc_html($canonical_url) . '"
|
||||
placeholder="' . esc_html($placeholder) . '" />';
|
||||
return str_replace('##CONTENTS##', $add_meta, $form);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ if (!class_exists('mtee_meta_output_canonical')) {
|
||||
}
|
||||
|
||||
if ($canonical) {
|
||||
return '<link rel="canonical" href="' . $canonical . '">' . PHP_EOL;
|
||||
return '<link rel="canonical" href="' . esc_html($canonical) . '">' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ if (!class_exists('mtee_meta_output_keydesc')) {
|
||||
$type = 'custom_tax';
|
||||
}
|
||||
$meta_data = array(
|
||||
MTEE_CONFIG::MTEE_NAME_KEYWORDS => str_replace('、', ',', $this->post_output_get_meta_keywords($type)),
|
||||
MTEE_CONFIG::MTEE_NAME_DESCRIPTION => $this->post_output_get_meta_desc($type),
|
||||
MTEE_CONFIG::MTEE_NAME_KEYWORDS => esc_html(str_replace('、', ',', $this->post_output_get_meta_keywords($type))),
|
||||
MTEE_CONFIG::MTEE_NAME_DESCRIPTION => esc_html($this->post_output_get_meta_desc($type)),
|
||||
);
|
||||
return $this->create_meta_tags($meta_data);
|
||||
}
|
||||
@@ -82,8 +82,8 @@ if (!class_exists('mtee_meta_output_keydesc')) {
|
||||
public function create_default_keywords_description(): array {
|
||||
$this->description .= $this->create_default_description();
|
||||
$meta_data = array(
|
||||
MTEE_CONFIG::MTEE_NAME_KEYWORDS => implode(',', $this->create_default_keywords()),
|
||||
MTEE_CONFIG::MTEE_NAME_DESCRIPTION => $this->description,
|
||||
MTEE_CONFIG::MTEE_NAME_KEYWORDS => esc_html(implode(',', $this->create_default_keywords())),
|
||||
MTEE_CONFIG::MTEE_NAME_DESCRIPTION => esc_html($this->description),
|
||||
);
|
||||
return $this->create_meta_tags($meta_data);
|
||||
}
|
||||
|
||||
@@ -49,17 +49,17 @@ if (!class_exists('mtee_meta_output_ogp')) {
|
||||
|
||||
|
||||
public function set_ogp_tag() {
|
||||
$tags = '<meta property="og:title" content="' . $this->ogp_title . '" />' . PHP_EOL;
|
||||
$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:title" content="' . esc_html($this->ogp_title) . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:description" content="' . esc_html($this->ogp_description) . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:type" content="' . esc_html($this->ogp_type) . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:url" content="' . esc_html($this->ogp_url) . '" />' . PHP_EOL;
|
||||
if (!empty($this->ogp_img)) {
|
||||
$tags .= '<meta property="og:image" content="' . $this->ogp_img . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:image" content="' . esc_html($this->ogp_img) . '" />' . PHP_EOL;
|
||||
}
|
||||
$tags .= '<meta property="og:site_name" content="' . $this->site_name . '" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:site_name" content="' . esc_html($this->site_name) . '" />' . PHP_EOL;
|
||||
// $tags .= '<meta name="twitter:card" content="summary_large_image" />' . PHP_EOL;
|
||||
// $tags .= '<meta name="twitter:site" content="ツイッターのアカウント名" />' . PHP_EOL;
|
||||
$tags .= '<meta property="og:locale" content="' . $this->get_ogp_locale() . '" />' . "\n";
|
||||
$tags .= '<meta property="og:locale" content="' . esc_html($this->get_ogp_locale()) . '" />' . "\n";
|
||||
return $tags;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,15 +53,15 @@ if (!class_exists('mtee_noindexnofolow_setting')) {
|
||||
<div class="meta_noindex_nofollow_box">
|
||||
<div>
|
||||
<label style="font-weight: bold;">noindex</label>
|
||||
<input type="hidden" name="' . MTEE_CONFIG::MTEE_NAME_NOINDEX . '" value="0" />
|
||||
<input type="checkbox" name="' . MTEE_CONFIG::MTEE_NAME_NOINDEX . '" value="1"';
|
||||
checked($noindex_value, 1);
|
||||
<input type="hidden" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_NOINDEX) . '" value="0" />
|
||||
<input type="checkbox" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_NOINDEX) . '" value="1"';
|
||||
checked(esc_html($noindex_value), 1);
|
||||
echo ' /></div>
|
||||
<div>
|
||||
<label style="font-weight: bold;">nofollow</label>
|
||||
<input type="hidden" name="' . MTEE_CONFIG::MTEE_NAME_NOFOLLOW . '" value="0" />
|
||||
<input type="checkbox" name="' . MTEE_CONFIG::MTEE_NAME_NOFOLLOW . '" value="1"';
|
||||
checked($nofollow_value, 1);
|
||||
<input type="hidden" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_NOFOLLOW) . '" value="0" />
|
||||
<input type="checkbox" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_NOFOLLOW) . '" value="1"';
|
||||
checked(esc_html($nofollow_value), 1);
|
||||
echo '. />
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
@@ -49,31 +49,31 @@ if (!class_exists('mtee_ogp_post_setting')) {
|
||||
<label style="font-weight: bold; display: block">title</label>
|
||||
<div>
|
||||
<input style="width:100%" type="text"
|
||||
name="' . MTEE_CONFIG::MTEE_OGP_TITLE . '"
|
||||
value="' . get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_TITLE, true) . '"
|
||||
placeholder="' . $this->set_default_ogp_title() . '"/>
|
||||
name="' . esc_html(MTEE_CONFIG::MTEE_OGP_TITLE) . '"
|
||||
value="' . esc_html(get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_TITLE, true)) . '"
|
||||
placeholder="' . esc_html($this->set_default_ogp_title()) . '"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta_key_desc_box">
|
||||
<label style="font-weight: bold; display: block">description</label>
|
||||
<div>
|
||||
<input style="width:100%" type="text"
|
||||
name="' . MTEE_CONFIG::MTEE_OGP_DESC . '"
|
||||
value="' . get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_DESC, true) . '"
|
||||
placeholder="' . $this->set_default_ogp_desc() . '"/>
|
||||
name="' . esc_html(MTEE_CONFIG::MTEE_OGP_DESC) . '"
|
||||
value="' . esc_html(get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_DESC, true)) . '"
|
||||
placeholder="' . esc_html($this->set_default_ogp_desc()) . '"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="meta_key_desc_box">
|
||||
<label style="font-weight: bold; display: block">image</label>
|
||||
<div>
|
||||
<input class="' . MTEE_CONFIG::MTEE_OGP_IMG . '" name="' . MTEE_CONFIG::MTEE_OGP_IMG . '" type="hidden" value="' . get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_IMG, true) . '" />
|
||||
<input class="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" type="hidden" value="' . esc_html(get_post_meta($post->ID, MTEE_CONFIG::MTEE_OGP_IMG, true)) . '" />
|
||||
<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">' . $this->set_ogp_thumb($post->ID) . '</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
var ogp_img_name = ' . "'" . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . "'" . '
|
||||
</script>';
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
public function set_ogp_thumb($id): string {
|
||||
$ogp_thumb = get_post_meta($id, MTEE_CONFIG::MTEE_OGP_IMG, true);
|
||||
if (!empty($ogp_thumb)) {
|
||||
return '<img src="' . wp_get_attachment_image_src($ogp_thumb, 'thumbnail')[0] . '">';
|
||||
return '<img src="' . esc_html(wp_get_attachment_image_src($ogp_thumb, 'thumbnail')[0]) . '">';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -50,26 +50,26 @@ if (!class_exists('mtee_ogp_tax_setting')) {
|
||||
echo '
|
||||
<div class="form-field">
|
||||
OGP title<br>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_OGP_TITLE . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_TITLE) . '"
|
||||
value=""
|
||||
placeholder="' . $input_values['title_pl'] . '"
|
||||
placeholder="' . esc_html($input_values['title_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
</div>
|
||||
<div class="form-field">
|
||||
OGP description<br>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_OGP_DESC . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_DESC) . '"
|
||||
value=""
|
||||
placeholder="' . $input_values['desc_pl'] . '"
|
||||
placeholder="' . esc_html($input_values['desc_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
</div>
|
||||
<div class="form-field">
|
||||
image<br>
|
||||
<input class="' . MTEE_CONFIG::MTEE_OGP_IMG . '" name="' . MTEE_CONFIG::MTEE_OGP_IMG . '" type="hidden" value="" />
|
||||
<input class="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" type="hidden" value="" />
|
||||
<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"></div>
|
||||
<script>
|
||||
var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
var ogp_img_name = ' . "'" . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . "'" . '
|
||||
</script>
|
||||
</div>
|
||||
';
|
||||
@@ -82,23 +82,23 @@ var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
<th scope="row">OGP</th>
|
||||
<td>
|
||||
<label class="mtee-label">title:</label>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_OGP_TITLE . '"
|
||||
value="' . $input_values['title'] . '"
|
||||
placeholder="' . $input_values['title_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_TITLE) . '"
|
||||
value="' . esc_html($input_values['title']) . '"
|
||||
placeholder="' . esc_html($input_values['title_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
|
||||
<label class="mtee-label">description:</label>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_OGP_DESC . '"
|
||||
value="' . $input_values['desc'] . '"
|
||||
placeholder="' . $input_values['desc_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_DESC) . '"
|
||||
value="' . esc_html($input_values['desc']) . '"
|
||||
placeholder="' . esc_html($input_values['desc_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
<label class="mtee-label">image:</label>
|
||||
<input class="' . MTEE_CONFIG::MTEE_OGP_IMG . '" name="' . MTEE_CONFIG::MTEE_OGP_IMG . '" type="hidden" value="' . get_post_meta($tag->term_id, MTEE_CONFIG::MTEE_OGP_IMG, true) . '" />
|
||||
<input class="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" name="' . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . '" type="hidden" value="' . esc_html(get_post_meta($tag->term_id, MTEE_CONFIG::MTEE_OGP_IMG, true)) . '" />
|
||||
<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">' . $this->set_ogp_thumb($tag->term_id) . '</div>
|
||||
<script>
|
||||
var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
var ogp_img_name = ' . "'" . esc_html(MTEE_CONFIG::MTEE_OGP_IMG) . "'" . '
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -135,7 +135,7 @@ var ogp_img_name = ' . "'" . MTEE_CONFIG::MTEE_OGP_IMG . "'" . '
|
||||
public function set_ogp_thumb($id): string {
|
||||
$ogp_thumb = get_post_meta($id, MTEE_CONFIG::MTEE_OGP_IMG, true);
|
||||
if (!empty($ogp_thumb)) {
|
||||
return '<img src="' . wp_get_attachment_image_src($ogp_thumb, 'thumbnail')[0] . '">';
|
||||
return '<img src="' . esc_html(wp_get_attachment_image_src($ogp_thumb, 'thumbnail')[0]) . '">';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ if (!class_exists('mtee_post_setting')) {
|
||||
global $post;
|
||||
echo '<div class="meta_key_desc_box">
|
||||
<label style="font-weight: bold; display: block">meta keywords</label>
|
||||
<div><input style="width:100%" type="text" name="' . MTEE_CONFIG::MTEE_NAME_KEYWORDS . '"
|
||||
value="' . get_post_meta($post->ID, MTEE_CONFIG::MTEE_NAME_KEYWORDS, true) . '"
|
||||
placeholder="' . $this->set_default_keywords() . '"/>
|
||||
<div><input style="width:100%" type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_KEYWORDS) . '"
|
||||
value="' . esc_html(get_post_meta($post->ID, MTEE_CONFIG::MTEE_NAME_KEYWORDS, true)) . '"
|
||||
placeholder="' . esc_html($this->set_default_keywords()) . '"/>
|
||||
</div>';
|
||||
echo '<label style="font-weight: bold; display: block">meta description</label>
|
||||
<div><input style="width:100%" type="text" name="' . MTEE_CONFIG::MTEE_NAME_DESCRIPTION . '"
|
||||
value="' . get_post_meta($post->ID, MTEE_CONFIG::MTEE_NAME_DESCRIPTION, true) . '"
|
||||
placeholder="' . $this->set_default_description() . '"/>
|
||||
<div><input style="width:100%" type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_DESCRIPTION) . '"
|
||||
value="' . esc_html(get_post_meta($post->ID, MTEE_CONFIG::MTEE_NAME_DESCRIPTION, true)) . '"
|
||||
placeholder="' . esc_html($this->set_default_description()) . '"/>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
+12
-12
@@ -45,16 +45,16 @@ if (!class_exists('mtee_tax_setting')) {
|
||||
echo '
|
||||
<div class="form-field">
|
||||
meta keywords<br>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_NAME_KEYWORDS . '"
|
||||
value="' . $input_values['keywords'] . '"
|
||||
placeholder="' . $input_values['keyword_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_KEYWORDS) . '"
|
||||
value="' . esc_html($input_values['keywords']) . '"
|
||||
placeholder="' . esc_html($input_values['keyword_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
</div>
|
||||
<div class="form-field">
|
||||
meta description<br>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_NAME_DESCRIPTION . '"
|
||||
value="' . $input_values['desc'] . '"
|
||||
placeholder="' . $input_values['desc_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_DESCRIPTION) . '"
|
||||
value="' . esc_html($input_values['desc']) . '"
|
||||
placeholder="' . esc_html($input_values['desc_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
</div>
|
||||
';
|
||||
@@ -67,14 +67,14 @@ class="tax-meta-field" />
|
||||
<th scope="row">meta keywords<br>meta description</th>
|
||||
<td>
|
||||
<label class="mtee-label">meta keywords:</label>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_NAME_KEYWORDS . '"
|
||||
value="' . $input_values['keywords'] . '"
|
||||
placeholder="' . $input_values['keyword_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_KEYWORDS) . '"
|
||||
value="' . esc_html($input_values['keywords']) . '"
|
||||
placeholder="' . esc_html($input_values['keyword_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
<label class="mtee-label">meta description:</label>
|
||||
<input type="text" name="' . MTEE_CONFIG::MTEE_NAME_DESCRIPTION . '"
|
||||
value="' . $input_values['desc'] . '"
|
||||
placeholder="' . $input_values['desc_pl'] . '"
|
||||
<input type="text" name="' . esc_html(MTEE_CONFIG::MTEE_NAME_DESCRIPTION) . '"
|
||||
value="' . esc_html($input_values['desc']) . '"
|
||||
placeholder="' . esc_html($input_values['desc_pl']) . '"
|
||||
class="tax-meta-field" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+32
-44
@@ -1,15 +1,15 @@
|
||||
<?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');
|
||||
$canonical_setting = $this->get_key_setting('canonical_setting');
|
||||
$wp_ver_disabled = $this->get_key_setting('wp_ver_disabled');
|
||||
$asset_ver_disabled = $this->get_key_setting('asset_ver_disabled');
|
||||
$emoji_disabled = $this->get_key_setting('emoji_disabled');
|
||||
$rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
//$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');
|
||||
//$canonical_setting = $this->get_key_setting('canonical_setting');
|
||||
//$wp_ver_disabled = $this->get_key_setting('wp_ver_disabled');
|
||||
//$asset_ver_disabled = $this->get_key_setting('asset_ver_disabled');
|
||||
//$emoji_disabled = $this->get_key_setting('emoji_disabled');
|
||||
//$rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2>meta keyword, description / バージョン情報 設定</h2>
|
||||
@@ -24,55 +24,49 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
</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 esc_html($mtee_set_nav); ?>">
|
||||
<input type="hidden" id="mtee_set_nav" name="mtee_set_nav"
|
||||
value="<?php echo esc_html($_POST['mtee_set_nav'] ?? 'nav_metas'); ?>">
|
||||
<div class="mtee_tab_box">
|
||||
<div class="mtee-form-box">
|
||||
<h2>メタキーワード・ディスクリプション</h2>
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[enabled]" value="0">
|
||||
<input type="checkbox" name="_mtee[enabled]" <?php checked($enabled, 1); ?>
|
||||
<input type="checkbox" name="_mtee[enabled]" <?php checked($this->get_key_setting('enabled'), 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
</div>
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>meta keywords テンプレート設定</h3>
|
||||
<p>個別設定していない投稿やカテゴリー等は、このテンプレートを適用します。</p>
|
||||
<?php
|
||||
$post_meta_keywords_tmp = $this->set_escape_str($opt, 'keywords_tmp', 'post');
|
||||
$page_meta_keywords_tmp = $this->set_escape_str($opt, 'keywords_tmp', 'page');
|
||||
$cat_meta_keywords_tmp = $this->set_escape_str($opt, 'keywords_tmp', 'category');
|
||||
$tag_meta_keywords_tmp = $this->set_escape_str($opt, 'keywords_tmp', 'tag');
|
||||
$tax_meta_keywords_tmp = $this->set_escape_str($opt, 'keywords_tmp', 'tax');
|
||||
?>
|
||||
<dl class="mtee_description_tmp_list">
|
||||
<dt>投稿</dt>
|
||||
<dd>
|
||||
<input class="mtee_keywords_tmp" type="text" name="_mtee[keywords_tmp][post]"
|
||||
value="<?php echo $post_meta_keywords_tmp; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'keywords_tmp', 'post'); ?>"
|
||||
placeholder="##title##,##category##,##tag##,##custom_tax##,##description##,##site_name##"
|
||||
</dd>
|
||||
<dt>ページ</dt>
|
||||
<dd>
|
||||
<input class="mtee_keywords_tmp" type="text" name="_mtee[keywords_tmp][page]"
|
||||
value="<?php echo $page_meta_keywords_tmp; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'keywords_tmp', 'page'); ?>"
|
||||
placeholder="##title##,##description##,##site_name##"
|
||||
</dd>
|
||||
<dt>カテゴリー</dt>
|
||||
<dd>
|
||||
<input class="mtee_keywords_tmp" type="text" name="_mtee[keywords_tmp][category]"
|
||||
value="<?php echo $cat_meta_keywords_tmp; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'keywords_tmp', 'category'); ?>"
|
||||
placeholder="##title##,##description##,##site_name##">
|
||||
</dd>
|
||||
<dt>タグ</dt>
|
||||
<dd>
|
||||
<input class="mtee_keywords_tmp" type="text" name="_mtee[keywords_tmp][tag]"
|
||||
value="<?php echo $tag_meta_keywords_tmp; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'keywords_tmp', 'tag'); ?>"
|
||||
placeholder="##title##,##description##,##site_name##">
|
||||
</dd>
|
||||
<dt>カスタム分類</dt>
|
||||
<dd>
|
||||
<input class="mtee_keywords_tmp" type="text" name="_mtee[keywords_tmp][tax]"
|
||||
value="<?php echo $tax_meta_keywords_tmp; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'keywords_tmp', 'tax'); ?>"
|
||||
placeholder="##title##,##description##,##site_name##">
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -96,36 +90,30 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<div class="mtee-form-box mtee_box_border">
|
||||
<h3>meta description テンプレート設定</h3>
|
||||
<p>個別設定していない投稿やカテゴリー等は、このテンプレートを適用します。</p>
|
||||
<?php
|
||||
$page_meta_desc_tmp = $this->set_escape_str($opt, 'description_tmp', 'page');
|
||||
$cat_meta_desc_tmp = $this->set_escape_str($opt, 'description_tmp', 'category');
|
||||
$tag_meta_desc_tmp = $this->set_escape_str($opt, 'description_tmp', 'tag');
|
||||
$tax_meta_desc_tmp = $this->set_escape_str($opt, 'description_tmp', 'tax');
|
||||
?>
|
||||
<dl class="mtee_description_tmp_list">
|
||||
<dt>ページ/投稿</dt>
|
||||
<dd>
|
||||
<input class="mtee_description_tmp" type="text" name="_mtee[description_tmp][page]"
|
||||
value="<?php echo $page_meta_desc_tmp; ?>"
|
||||
placeholder="##site_name##の<?php echo MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS; ?>##title##<?php echo MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS; ?><?php echo MTEE_CONFIG::MTEE_META_DESC_SINGLE_BASE; ?>"
|
||||
value="<?php echo $this->set_escape_str($opt, 'description_tmp', 'page'); ?>"
|
||||
placeholder="##site_name##の<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS); ?>##title##<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS); ?><?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_SINGLE_BASE); ?>"
|
||||
</dd>
|
||||
<dt>カテゴリー</dt>
|
||||
<dd>
|
||||
<input class="mtee_description_tmp" type="text" name="_mtee[description_tmp][category]"
|
||||
value="<?php echo $cat_meta_desc_tmp; ?>"
|
||||
placeholder="##site_name##の<?php echo MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS; ?>##title##<?php echo MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS; ?><?php echo MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
value="<?php echo $this->set_escape_str($opt, 'description_tmp', 'category'); ?>"
|
||||
placeholder="##site_name##の<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS); ?>##title##<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS); ?><?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE); ?>">
|
||||
</dd>
|
||||
<dt>タグ</dt>
|
||||
<dd>
|
||||
<input class="mtee_description_tmp" type="text" name="_mtee[description_tmp][tag]"
|
||||
value="<?php echo $tag_meta_desc_tmp; ?>"
|
||||
placeholder="##site_name##の<?php echo MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS; ?>##title##<?php echo MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS; ?><?php echo MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
value="<?php echo $this->set_escape_str($opt, 'description_tmp', 'tag'); ?>"
|
||||
placeholder="##site_name##の<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS); ?>##title##<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS); ?><?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE); ?>">
|
||||
</dd>
|
||||
<dt>カスタム分類</dt>
|
||||
<dd>
|
||||
<input class="mtee_description_tmp" type="text" name="_mtee[description_tmp][tax]"
|
||||
value="<?php echo $tax_meta_desc_tmp; ?>"
|
||||
placeholder="##site_name##の<?php echo MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS; ?>##title##<?php echo MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS; ?><?php echo MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
value="<?php echo $this->set_escape_str($opt, 'description_tmp', 'tax'); ?>"
|
||||
placeholder="##site_name##の<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_BEFORE_BRACKETS); ?>##title##<?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_AFTER_BRACKETS); ?><?php echo esc_html(MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE); ?>">
|
||||
</dd>
|
||||
</dl>
|
||||
<ul>
|
||||
@@ -143,7 +131,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[ogp_setting]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[ogp_setting]" <?php checked($ogp_setting, 1); ?>
|
||||
name="_mtee[ogp_setting]" <?php checked($this->get_key_setting('ogp_setting'), 1); ?>
|
||||
value="1">有効(デフォルトのog:descriptionはmeta descriptionになります)
|
||||
</label>
|
||||
</div>
|
||||
@@ -155,7 +143,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[noindex_nofollow]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[noindex_nofollow]" <?php checked($noindex_nofollow, 1); ?>
|
||||
name="_mtee[noindex_nofollow]" <?php checked($this->get_key_setting('noindex_nofollow'), 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
<?php include 'pages_noindexnofollow.php'; ?>
|
||||
@@ -166,7 +154,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[canonical_setting]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[canonical_setting]" <?php checked($canonical_setting, 1); ?>
|
||||
name="_mtee[canonical_setting]" <?php checked($this->get_key_setting('canonical_setting'), 1); ?>
|
||||
value="1">有効
|
||||
</label>
|
||||
</div>
|
||||
@@ -180,7 +168,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[rss_disabled]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[rss_disabled]" <?php checked($rss_disabled, 1); ?>
|
||||
name="_mtee[rss_disabled]" <?php checked($this->get_key_setting('rss_disabled'), 1); ?>
|
||||
value="1">出力しない
|
||||
</label>
|
||||
</div>
|
||||
@@ -189,7 +177,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[wp_ver_disabled]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[wp_ver_disabled]" <?php checked($wp_ver_disabled, 1); ?>
|
||||
name="_mtee[wp_ver_disabled]" <?php checked($this->get_key_setting('wp_ver_disabled'), 1); ?>
|
||||
value="1">表示しない
|
||||
</label>
|
||||
</div>
|
||||
@@ -198,7 +186,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[asset_ver_disabled]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[asset_ver_disabled]" <?php checked($asset_ver_disabled, 1); ?>
|
||||
name="_mtee[asset_ver_disabled]" <?php checked($this->get_key_setting('asset_ver_disabled'), 1); ?>
|
||||
value="1">表示しない
|
||||
</label>
|
||||
</div>
|
||||
@@ -207,7 +195,7 @@ $rss_disabled = $this->get_key_setting('rss_disabled');
|
||||
<label>
|
||||
<input type="hidden" name="_mtee[emoji_disabled]" value="0">
|
||||
<input type="checkbox"
|
||||
name="_mtee[emoji_disabled]" <?php checked($emoji_disabled, 1); ?>
|
||||
name="_mtee[emoji_disabled]" <?php checked($this->get_key_setting('emoji_disabled'), 1); ?>
|
||||
value="1">表示しない
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$canonical_url = esc_html($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; ?>"
|
||||
value="<?php echo esc_html($opt['top_page']['canonical'] ?? ''); ?>"
|
||||
placeholder="<?php echo get_bloginfo('url'); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
@@ -17,9 +14,6 @@ $canonical_url = esc_html($opt['top_page']['canonical'] ?? '');
|
||||
<?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 = esc_html($opt['custom_post'][$custom_post]['canonical'] ?? '');
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
@@ -31,7 +25,7 @@ $canonical_url = esc_html($opt['top_page']['canonical'] ?? '');
|
||||
<th>Canonical URL</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo esc_html($custom_post); ?>][canonical]"
|
||||
value="<?php echo $canonical_url; ?>"
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['canonical'] ?? ''); ?>"
|
||||
placeholder="<?php echo get_post_type_archive_link($custom_post); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+6
-12
@@ -1,21 +1,18 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$keywords = esc_html($opt['top_page']['keywords'] ?? '');
|
||||
$description = esc_html($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">
|
||||
value="<?php echo esc_html($opt['top_page']['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; ?>"
|
||||
value="<?php echo esc_html($opt['top_page']['description'] ?? ''); ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の<?php echo MTEE_CONFIG::MTEE_META_DESC_TOP_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
@@ -24,10 +21,6 @@ $description = esc_html($opt['top_page']['description'] ?? '');
|
||||
<?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 = esc_html($opt['custom_post'][$custom_post]['keywords'] ?? '');
|
||||
$description = esc_html($opt['custom_post'][$custom_post]['description'] ?? '');
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
@@ -39,7 +32,8 @@ $description = esc_html($opt['top_page']['description'] ?? '');
|
||||
<th>meta keywords</th>
|
||||
<td><input class="top_page_keywords" type="text"
|
||||
name="_mtee[custom_post][<?php echo esc_html($custom_post); ?>][keywords]"
|
||||
value="<?php echo $keywords; ?>" placeholder="キーワード1,キーワード2,キーワード3">
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['keywords'] ?? ''); ?>"
|
||||
placeholder="キーワード1,キーワード2,キーワード3">
|
||||
<br>キーワードはカンマ(,)区切りで入力してください
|
||||
</td>
|
||||
</tr>
|
||||
@@ -47,7 +41,7 @@ $description = esc_html($opt['top_page']['description'] ?? '');
|
||||
<th>meta description</th>
|
||||
<td><input class="top_page_description" type="text"
|
||||
name="_mtee[custom_post][<?php echo esc_html($custom_post); ?>][description]"
|
||||
value="<?php echo $description; ?>"
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['description'] ?? ''); ?>"
|
||||
placeholder="<?php echo get_bloginfo('name'); ?>の[カスタム投稿ラベル]<?php echo MTEE_CONFIG::MTEE_META_DESC_ARCHIVE_BASE; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
+10
-19
@@ -1,28 +1,24 @@
|
||||
<h2 class="mtee_page_title mtee_box_border">トップページ</h2>
|
||||
<?php
|
||||
$ogp_title = esc_html($opt['top_page']['ogp_title'] ?? '');
|
||||
$ogp_description = esc_html($opt['top_page']['ogp_description'] ?? '');
|
||||
$ogp_img = esc_html($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; ?>">
|
||||
value="<?php echo esc_html($opt['top_page']['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; ?>">
|
||||
value="<?php echo esc_html($opt['top_page']['ogp_description'] ?? ''); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_CONFIG::MTEE_OGP_IMG; ?>" name="_mtee[top_page][ogp_img]" type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
<input class="<?php echo esc_html(MTEE_CONFIG::MTEE_OGP_IMG); ?>" name="_mtee[top_page][ogp_img]"
|
||||
type="hidden"
|
||||
value="<?php echo esc_html($opt['top_page']['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>
|
||||
@@ -33,11 +29,6 @@ $ogp_img = esc_html($opt['top_page']['ogp_img'] ?? '');
|
||||
<?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 = esc_html($opt['custom_post'][$custom_post]['ogp_title'] ?? '');
|
||||
$ogp_description = esc_html($opt['custom_post'][$custom_post]['ogp_description'] ?? '');
|
||||
$ogp_img = esc_html($opt['custom_post'][$custom_post]['ogp_img'] ?? '');
|
||||
?>
|
||||
<?php wp_nonce_field('check_options'); ?>
|
||||
<div class="mtee-form-box">
|
||||
<h3 class="mtee_page_archive_title">
|
||||
@@ -49,23 +40,23 @@ $ogp_img = esc_html($opt['top_page']['ogp_img'] ?? '');
|
||||
<th>OGP title</th>
|
||||
<td><input class="top_page_keywords" type="text"
|
||||
name="_mtee[custom_post][<?php echo esc_html($custom_post); ?>][ogp_title]"
|
||||
value="<?php echo $ogp_title; ?>">
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['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 esc_html($custom_post); ?>][ogp_description]"
|
||||
value="<?php echo $ogp_description; ?>">
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['ogp_description'] ?? ''); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th>OGP Image</th>
|
||||
<td>
|
||||
<input class="<?php echo MTEE_CONFIG::MTEE_OGP_IMG; ?>"
|
||||
<input class="<?php echo esc_html(MTEE_CONFIG::MTEE_OGP_IMG); ?>"
|
||||
name="_mtee[custom_post][<?php echo esc_html($custom_post); ?>][ogp_img]"
|
||||
type="hidden"
|
||||
value="<?php echo $ogp_img; ?>"/>
|
||||
value="<?php echo esc_html($opt['custom_post'][$custom_post]['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>
|
||||
@@ -76,6 +67,6 @@ $ogp_img = esc_html($opt['top_page']['ogp_img'] ?? '');
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<script>
|
||||
var ogp_img_name = "<?php echo MTEE_CONFIG::MTEE_OGP_IMG; ?>"
|
||||
var ogp_img_name = "<?php echo esc_html(MTEE_CONFIG::MTEE_OGP_IMG); ?>"
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user