diff --git a/class/mtee.php b/class/mtee.php index 54cce1d..f283527 100644 --- a/class/mtee.php +++ b/class/mtee.php @@ -81,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 ''; diff --git a/js/mtee.js b/js/mtee.js index 99129a9..bd13375 100644 --- a/js/mtee.js +++ b/js/mtee.js @@ -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(); + } + }); + } + } diff --git a/meta-tag-etc-extend.php b/meta-tag-etc-extend.php index a6ea290..a1addd6 100644 --- a/meta-tag-etc-extend.php +++ b/meta-tag-etc-extend.php @@ -25,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; diff --git a/template/index.php b/template/index.php index 00371c9..0436bdd 100644 --- a/template/index.php +++ b/template/index.php @@ -1,6 +1,7 @@ get_key_setting('enabled'); $noindex_nofollow = $this->get_key_setting('noindex_nofollow'); $ogp_setting = $this->get_key_setting('ogp_setting'); @@ -14,15 +15,16 @@ $rss_disabled = $this->get_key_setting('rss_disabled');

meta keyword, description / バージョン情報 設定

+

メタキーワード・ディスクリプション

diff --git a/template/pages_other.php b/template/pages_other.php deleted file mode 100644 index 97ef1cf..0000000 --- a/template/pages_other.php +++ /dev/null @@ -1,225 +0,0 @@ -

トップページ

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
meta keywords - is_enable('enabled')): ?> - ※現在無効です - - -
キーワードはカンマ(,)区切りで入力してください -
meta description - is_enable('enabled')): ?> - ※現在無効です - - -
noindex nofollow - is_enable('noindex_nofollow')): ?> - ※現在無効です - - -
- - -
-
Canonical URL - is_enable('canonical_setting')): ?> - ※現在無効です - -
OGP title - is_enable('enabled')): ?> - ※現在無効です - - -
OGP description - is_enable('enabled')): ?> - ※現在無効です - - -
OGP Image - - - -
get_ogp_img('top_page'); ?>
-
-
- 0): ?> -

カスタム投稿アーカイブ

- - - -
-

- label; ?> - () -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
meta keywords - is_enable('enabled')): ?> - ※現在無効です - -
キーワードはカンマ(,)区切りで入力してください -
meta description - is_enable('enabled')): ?> - ※現在無効です - -
noindex nofollow - is_enable('noindex_nofollow')): ?> - ※現在無効です - -
- - -
-
Canonical URL - is_enable('canonical_setting')): ?> - ※現在無効です - -
OGP keywords - is_enable('enabled')): ?> - ※現在無効です - -
OGP description - is_enable('enabled')): ?> - ※現在無効です - -
OGP Image - - - -
get_ogp_img('custom_post', $custom_post); ?>
-
-
- - -

- - diff --git a/template/success.php b/template/success.php index e97c95a..c91135f 100644 --- a/template/success.php +++ b/template/success.php @@ -1 +1 @@ -

設定を保存しました

\ No newline at end of file +

設定を保存しました