PageRenderTime 21ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/VnKings Theme/VnKing/wp-content/plugins/wordpress-seo/admin/pages/metas.php

https://gitlab.com/hop23typhu/list-theme
PHP | 223 lines | 191 code | 24 blank | 8 comment | 22 complexity | e33e57c6304c7841ad9dfdb90f435cb4 MD5 | raw file
  1. <?php
  2. /**
  3. * @package WPSEO\Admin
  4. */
  5. if ( ! defined( 'WPSEO_VERSION' ) ) {
  6. header( 'Status: 403 Forbidden' );
  7. header( 'HTTP/1.1 403 Forbidden' );
  8. exit();
  9. }
  10. $options = WPSEO_Options::get_all();
  11. $yform = Yoast_Form::get_instance();
  12. $yform->admin_header( true, 'wpseo_titles' );
  13. ?>
  14. <h2 class="nav-tab-wrapper" id="wpseo-tabs">
  15. <a class="nav-tab" id="general-tab" href="#top#general"><?php _e( 'General', 'wordpress-seo' ); ?></a>
  16. <a class="nav-tab" id="home-tab" href="#top#home"><?php _e( 'Homepage', 'wordpress-seo' ); ?></a>
  17. <a class="nav-tab" id="post_types-tab" href="#top#post_types"><?php _e( 'Post Types', 'wordpress-seo' ); ?></a>
  18. <a class="nav-tab" id="taxonomies-tab" href="#top#taxonomies"><?php _e( 'Taxonomies', 'wordpress-seo' ); ?></a>
  19. <a class="nav-tab" id="archives-tab" href="#top#archives"><?php _e( 'Archives', 'wordpress-seo' ); ?></a>
  20. <a class="nav-tab" id="other-tab" href="#top#other"><?php _e( 'Other', 'wordpress-seo' ); ?></a>
  21. </h2>
  22. <div class="tabwrapper">
  23. <div id="general" class="wpseotab">
  24. <table class="form-table">
  25. <tr>
  26. <th>
  27. <?php _e( 'Force rewrite titles', 'wordpress-seo' ); ?>
  28. </th>
  29. <td>
  30. <?php
  31. $yform->checkbox( 'forcerewritetitle', __( 'Enable force rewrite titles', 'wordpress-seo' ) );
  32. echo '<p class="description">', __( 'WordPress SEO has auto-detected whether it needs to force rewrite the titles for your pages, if you think it\'s wrong and you know what you\'re doing, you can change the setting here.', 'wordpress-seo' ), '</p>';
  33. ?>
  34. </td>
  35. </tr>
  36. <tr>
  37. <th>
  38. <?php _e( 'Title Separator', 'wordpress-seo' ); ?>
  39. </th>
  40. <td>
  41. <?php
  42. $yform->radio( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options(), '' );
  43. echo '<p class="description">', __( 'Choose the symbol to use as your title separator. This will display, for instance, between your post title and site name.', 'wordpress-seo' ), ' ', __( 'Symbols are shown in the size they\'ll appear in in search results.', 'wordpress-seo' ), '</p>';
  44. ?>
  45. </td>
  46. </tr>
  47. </table>
  48. </div>
  49. <div id="home" class="wpseotab">
  50. <?php
  51. if ( 'posts' == get_option( 'show_on_front' ) ) {
  52. echo '<p><strong>', __( 'Homepage', 'wordpress-seo' ), '</strong><br/>';
  53. $yform->textinput( 'title-home-wpseo', __( 'Title template', 'wordpress-seo' ), 'template homepage-template' );
  54. $yform->textarea( 'metadesc-home-wpseo', __( 'Meta description template', 'wordpress-seo' ), array( 'class' => 'template homepage-template' ) );
  55. if ( $options['usemetakeywords'] === true ) {
  56. $yform->textinput( 'metakey-home-wpseo', __( 'Meta keywords template', 'wordpress-seo' ) );
  57. }
  58. echo '</p>';
  59. }
  60. else {
  61. echo '<p><strong>', __( 'Homepage &amp; Front page', 'wordpress-seo' ), '</strong><br/>';
  62. printf( __( 'You can determine the title and description for the front page by %sediting the front page itself &raquo;%s', 'wordpress-seo' ), '<a href="' . esc_url( get_edit_post_link( get_option( 'page_on_front' ) ) ) . '">', '</a>' );
  63. echo '</p>';
  64. if ( get_option( 'page_for_posts' ) > 0 ) {
  65. echo '<p>', sprintf( __( 'You can determine the title and description for the blog page by %sediting the blog page itself &raquo;%s', 'wordpress-seo' ), '<a href="' . esc_url( get_edit_post_link( get_option( 'page_for_posts' ) ) ) . '">', '</a>' ), '</p>';
  66. }
  67. }
  68. ?>
  69. </div>
  70. <div id="post_types" class="wpseotab">
  71. <?php
  72. $post_types = get_post_types( array( 'public' => true ), 'objects' );
  73. if ( is_array( $post_types ) && $post_types !== array() ) {
  74. foreach ( $post_types as $pt ) {
  75. $warn = false;
  76. if ( $options['redirectattachment'] === true && $pt->name == 'attachment' ) {
  77. echo '<div class="wpseo-warning">';
  78. $warn = true;
  79. }
  80. $name = $pt->name;
  81. echo '<strong id="' . esc_attr( $name ) . '">' . esc_html( ucfirst( $pt->labels->name ) ) . '</strong><br/>';
  82. if ( $warn === true ) {
  83. echo '<h4 class="error-message">' . __( 'Take note:', 'wordpress-seo' ) . '</h4>';
  84. echo '<p class="error-message">' . __( 'As you are redirecting attachment URLs to parent post URLs, these settings will currently only have an effect on <strong>unattached</strong> media items!', 'wordpress-seo' ) . '</p>';
  85. echo '<p class="error-message">' . sprintf( __( 'So remember: If you change the %sattachment redirection setting%s in the future, the below settings will take effect for *all* media items.', 'wordpress-seo' ), '<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_permalinks' ) ) . '">', '</a>' ) . '</p>';
  86. }
  87. $yform->textinput( 'title-' . $name, __( 'Title template', 'wordpress-seo' ), 'template posttype-template' );
  88. $yform->textarea( 'metadesc-' . $name, __( 'Meta description template', 'wordpress-seo' ), array( 'class' => 'template posttype-template' ) );
  89. if ( $options['usemetakeywords'] === true ) {
  90. $yform->textinput( 'metakey-' . $name, __( 'Meta keywords template', 'wordpress-seo' ) );
  91. }
  92. $yform->checkbox( 'noindex-' . $name, '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
  93. $yform->checkbox( 'showdate-' . $name, __( 'Show date in snippet preview?', 'wordpress-seo' ), __( 'Date in Snippet Preview', 'wordpress-seo' ) );
  94. $yform->checkbox( 'hideeditbox-' . $name, __( 'Hide', 'wordpress-seo' ), __( 'WordPress SEO Meta Box', 'wordpress-seo' ) );
  95. /**
  96. * Allow adding a custom checkboxes to the admin meta page - Post Types tab
  97. * @api WPSEO_Admin_Pages $yform The WPSEO_Admin_Pages object
  98. * @api String $name The post type name
  99. */
  100. do_action( 'wpseo_admin_page_meta_post_types', $yform, $name );
  101. echo '<br/><br/>';
  102. if ( $warn === true ) {
  103. echo '</div>';
  104. }
  105. unset( $warn );
  106. }
  107. unset( $pt );
  108. }
  109. unset( $post_types );
  110. $post_types = get_post_types( array( '_builtin' => false, 'has_archive' => true ), 'objects' );
  111. if ( is_array( $post_types ) && $post_types !== array() ) {
  112. echo '<h2>' . __( 'Custom Post Type Archives', 'wordpress-seo' ) . '</h2>';
  113. echo '<p>' . __( 'Note: instead of templates these are the actual titles and meta descriptions for these custom post type archive pages.', 'wordpress-seo' ) . '</p>';
  114. foreach ( $post_types as $pt ) {
  115. $name = $pt->name;
  116. echo '<strong>' . esc_html( ucfirst( $pt->labels->name ) ) . '</strong><br/>';
  117. $yform->textinput( 'title-ptarchive-' . $name, __( 'Title', 'wordpress-seo' ), 'template posttype-template' );
  118. $yform->textarea( 'metadesc-ptarchive-' . $name, __( 'Meta description', 'wordpress-seo' ), array( 'class' => 'template posttype-template' ) );
  119. if ( $options['usemetakeywords'] === true ) {
  120. $yform->textinput( 'metakey-ptarchive-' . $name, __( 'Meta keywords', 'wordpress-seo' ) );
  121. }
  122. if ( $options['breadcrumbs-enable'] === true ) {
  123. $yform->textinput( 'bctitle-ptarchive-' . $name, __( 'Breadcrumbs title', 'wordpress-seo' ) );
  124. }
  125. $yform->checkbox( 'noindex-ptarchive-' . $name, '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
  126. echo '<br/><br/>';
  127. }
  128. unset( $pt );
  129. }
  130. unset( $post_types );
  131. ?>
  132. </div>
  133. <div id="taxonomies" class="wpseotab">
  134. <?php
  135. $taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );
  136. if ( is_array( $taxonomies ) && $taxonomies !== array() ) {
  137. foreach ( $taxonomies as $tax ) {
  138. echo '<strong>' . esc_html( ucfirst( $tax->labels->name ) ) . '</strong><br/>';
  139. $yform->textinput( 'title-tax-' . $tax->name, __( 'Title template', 'wordpress-seo' ), 'template taxonomy-template' );
  140. $yform->textarea( 'metadesc-tax-' . $tax->name, __( 'Meta description template', 'wordpress-seo' ), array( 'class' => 'template taxonomy-template' ) );
  141. if ( $options['usemetakeywords'] === true ) {
  142. $yform->textinput( 'metakey-tax-' . $tax->name, __( 'Meta keywords template', 'wordpress-seo' ) );
  143. }
  144. $yform->checkbox( 'noindex-tax-' . $tax->name, '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
  145. $yform->checkbox( 'hideeditbox-tax-' . $tax->name, __( 'Hide', 'wordpress-seo' ), __( 'WordPress SEO Meta Box', 'wordpress-seo' ) );
  146. echo '<br/><br/>';
  147. }
  148. unset( $tax );
  149. }
  150. unset( $taxonomies );
  151. ?>
  152. </div>
  153. <div id="archives" class="wpseotab">
  154. <?php
  155. echo '<strong>' . __( 'Author Archives', 'wordpress-seo' ) . '</strong><br/>';
  156. $yform->textinput( 'title-author-wpseo', __( 'Title template', 'wordpress-seo' ), 'template author-template' );
  157. $yform->textarea( 'metadesc-author-wpseo', __( 'Meta description template', 'wordpress-seo' ), array( 'class' => 'template author-template' ) );
  158. if ( $options['usemetakeywords'] === true ) {
  159. $yform->textinput( 'metakey-author-wpseo', __( 'Meta keywords template', 'wordpress-seo' ) );
  160. }
  161. $yform->checkbox( 'noindex-author-wpseo', '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
  162. $yform->checkbox( 'disable-author', __( 'Disable the author archives', 'wordpress-seo' ), '' );
  163. echo '<p class="desc label">' . __( 'If you\'re running a one author blog, the author archive will always look exactly the same as your homepage. And even though you may not link to it, others might, to do you harm. Disabling them here will make sure any link to those archives will be 301 redirected to the homepage.', 'wordpress-seo' ) . '</p>';
  164. echo '<br/>';
  165. echo '<strong>' . __( 'Date Archives', 'wordpress-seo' ) . '</strong><br/>';
  166. $yform->textinput( 'title-archive-wpseo', __( 'Title template', 'wordpress-seo' ), 'template date-template' );
  167. $yform->textarea( 'metadesc-archive-wpseo', __( 'Meta description template', 'wordpress-seo' ), array( 'class' => 'template date-template' ) );
  168. echo '<br/>';
  169. $yform->checkbox( 'noindex-archive-wpseo', '<code>noindex, follow</code>', __( 'Meta Robots', 'wordpress-seo' ) );
  170. $yform->checkbox( 'disable-date', __( 'Disable the date-based archives', 'wordpress-seo' ), '' );
  171. echo '<p class="desc label">' . __( 'For the date based archives, the same applies: they probably look a lot like your homepage, and could thus be seen as duplicate content.', 'wordpress-seo' ) . '</p>';
  172. echo '<h2>' . __( 'Special Pages', 'wordpress-seo' ) . '</h2>';
  173. echo '<p>' . __( 'These pages will be noindex, followed by default, so they will never show up in search results.', 'wordpress-seo' ) . '</p>';
  174. echo '<p><strong>' . __( 'Search pages', 'wordpress-seo' ) . '</strong><br/>';
  175. $yform->textinput( 'title-search-wpseo', __( 'Title template', 'wordpress-seo' ), 'template search-template' );
  176. echo '</p>';
  177. echo '<p><strong>' . __( '404 pages', 'wordpress-seo' ) . '</strong><br/>';
  178. $yform->textinput( 'title-404-wpseo', __( 'Title template', 'wordpress-seo' ), 'template error404-template' );
  179. echo '</p>';
  180. echo '<br class="clear"/>';
  181. ?>
  182. </div>
  183. <div id="other" class="wpseotab">
  184. <strong><?php _e( 'Sitewide <code>meta</code> settings', 'wordpress-seo' ); ?></strong><br/>
  185. <br/>
  186. <?php
  187. $yform->checkbox( 'noindex-subpages-wpseo', __( 'Noindex subpages of archives', 'wordpress-seo' ) );
  188. echo '<p class="desc">', __( 'If you want to prevent /page/2/ and further of any archive to show up in the search results, enable this.', 'wordpress-seo' ), '</p>';
  189. $yform->checkbox( 'usemetakeywords', __( 'Use <code>meta</code> keywords tag?', 'wordpress-seo' ) );
  190. echo '<p class="desc">', __( 'I don\'t know why you\'d want to use meta keywords, but if you want to, check this box.', 'wordpress-seo' ), '</p>';
  191. $yform->checkbox( 'noodp', __( 'Add <code>noodp</code> meta robots tag sitewide', 'wordpress-seo' ) );
  192. echo '<p class="desc">', __( 'Prevents search engines from using the DMOZ description for pages from this site in the search results.', 'wordpress-seo' ), '</p>';
  193. $yform->checkbox( 'noydir', __( 'Add <code>noydir</code> meta robots tag sitewide', 'wordpress-seo' ) );
  194. echo '<p class="desc">', __( 'Prevents search engines from using the Yahoo! directory description for pages from this site in the search results.', 'wordpress-seo' ), '</p>';
  195. ?>
  196. </div>
  197. </div>
  198. <?php
  199. $yform->admin_footer();