js-templates-primary-term.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin
  6. */
  7. if ( ! defined( 'WPSEO_VERSION' ) ) {
  8. header( 'Status: 403 Forbidden' );
  9. header( 'HTTP/1.1 403 Forbidden' );
  10. exit();
  11. }
  12. ?>
  13. <script type="text/html" id="tmpl-primary-term-ui">
  14. <?php
  15. /* translators: accessibility text. %1$s expands to the term title, %2$s to the taxonomy title. */
  16. $yoast_free_js_button_label = __( 'Make %1$s primary %2$s', 'wordpress-seo' );
  17. $yoast_free_js_button_label = sprintf(
  18. $yoast_free_js_button_label,
  19. '{{data.term}}',
  20. '{{data.taxonomy.title}}'
  21. );
  22. printf(
  23. '<button type="button" class="wpseo-make-primary-term" aria-label="%1$s">%2$s</button>',
  24. esc_attr( $yoast_free_js_button_label ),
  25. esc_html__( 'Make primary', 'wordpress-seo' )
  26. );
  27. ?>
  28. <span class="wpseo-is-primary-term" aria-hidden="true"><?php esc_html_e( 'Primary', 'wordpress-seo' ); ?></span>
  29. </script>
  30. <script type="text/html" id="tmpl-primary-term-screen-reader">
  31. <?php
  32. /* translators: %s is the taxonomy title. This will be shown to screenreaders */
  33. $yoast_free_js_taxonomy_title = __( 'Primary %s', 'wordpress-seo' );
  34. $yoast_free_js_taxonomy_title = sprintf(
  35. '(' . $yoast_free_js_taxonomy_title . ')',
  36. '{{data.taxonomy.title}}'
  37. );
  38. ?>
  39. <span class="screen-reader-text wpseo-primary-category-label"><?php echo esc_html( $yoast_free_js_taxonomy_title ); ?></span>
  40. </script>