diff --git a/class/mtee-ogp-setting.php b/class/mtee-ogp-setting.php new file mode 100644 index 0000000..bcd5c3f --- /dev/null +++ b/class/mtee-ogp-setting.php @@ -0,0 +1,52 @@ + array('page', 'post',), + ); + + foreach ($default_built_ins['posts'] as $built_in) { + add_meta_box( + 'canonical_setting', + 'Canonical設定', + array($this, 'insert_meta_fields'), + $built_in, + 'normal' + ); + } + + if (isset($this->options['custom_posts'])) { + foreach ($this->options['custom_posts'] as $custom_post => $post_chk) { + if ($post_chk == 1) { + add_meta_box( + 'canonical_setting', + 'Canonical設定', + array($this, 'insert_meta_fields'), + $custom_post, 'normal' + ); + } + } + } + } + + } + +} \ No newline at end of file diff --git a/class/mtee-output-ogp.php b/class/mtee-output-ogp.php new file mode 100644 index 0000000..cff6e84 --- /dev/null +++ b/class/mtee-output-ogp.php @@ -0,0 +1,30 @@ +create_ogp_prefix(); + return $output; + } + + private function create_ogp_prefix(): string { + return ' prefix="og: https://ogp.me/ns#"'; + } + } +} \ No newline at end of file