| 1 |
<?php |
| 2 |
|
| 3 |
// If this file is called directly, abort. |
| 4 |
if ( ! defined( 'WPINC' ) ) { |
| 5 |
die; |
| 6 |
} |
| 7 |
|
| 8 |
|
| 9 |
/** |
| 10 |
* Print HTML Option page : wpLingua Exclusions |
| 11 |
* |
| 12 |
* @return void |
| 13 |
*/ |
| 14 |
function wplng_option_page_exclusions() { |
| 15 |
|
| 16 |
?> |
| 17 |
<div class="wrap"> |
| 18 |
|
| 19 |
<h1 class="wp-heading-inline"><span class="dashicons dashicons-translation"></span> <?php esc_html_e( 'wpLingua - Exclusion rules', 'wplingua' ); ?></h1> |
| 20 |
|
| 21 |
<hr class="wp-header-end"> |
| 22 |
|
| 23 |
<form method="post" action="options.php"> |
| 24 |
<?php |
| 25 |
settings_fields( 'wplng_exclusions' ); |
| 26 |
do_settings_sections( 'wplng_exclusions' ); |
| 27 |
?> |
| 28 |
<table class="form-table wplng-form-table"> |
| 29 |
<tr> |
| 30 |
<th scope="row"><?php esc_html_e( 'Exclude elements', 'wplingua' ); ?></th> |
| 31 |
<td> |
| 32 |
<fieldset> |
| 33 |
<label for="wplng_excluded_selectors"><strong><?php esc_html_e( 'Exclude HTML elements:', 'wplingua' ); ?></strong></label> |
| 34 |
<p><?php esc_html_e( 'You can leave some elements of your web pages untranslated. To do this, list the element selectors to be excluded below, one per line. Examples:', 'wplingua' ); ?></p> |
| 35 |
<ul> |
| 36 |
<li><code>#website-main-title</code> - <?php esc_html_e( 'Exclude elements by ID attribute', 'wplingua' ); ?></li> |
| 37 |
<li><code>.author-name</code> - <?php esc_html_e( 'Exclude elements by class attribute', 'wplingua' ); ?></li> |
| 38 |
<li><code>.entry-content pre</code> - <?php esc_html_e( 'Exclude elements by CSS selector', 'wplingua' ); ?></li> |
| 39 |
</ul> |
| 40 |
<br> |
| 41 |
<textarea name="wplng_excluded_selectors" id="wplng_excluded_selectors" rows="6"><?php echo esc_textarea( get_option( 'wplng_excluded_selectors' ) ); ?></textarea> |
| 42 |
</fieldset> |
| 43 |
</td> |
| 44 |
</tr> |
| 45 |
<tr> |
| 46 |
<th scope="row"><?php esc_html_e( 'Exclude URL', 'wplingua' ); ?></th> |
| 47 |
<td> |
| 48 |
<fieldset> |
| 49 |
<label for="wplng_excluded_url"><strong><?php esc_html_e( 'Exclude URL from translation:', 'wplingua' ); ?></strong></label> |
| 50 |
<p><?php esc_html_e( 'You can exclude from translations pages you wish to offer only in the site\'s original language. To do this, List the REGEXs that match the URL to be excluded. Examples:', 'wplingua' ); ?></p> |
| 51 |
<ul> |
| 52 |
<li><code>^/my-page/$</code> - <?php esc_html_e( 'Exclude URL "/my-page/"', 'wplingua' ); ?></li> |
| 53 |
<li><code>^/my-page/</code> - <?php esc_html_e( 'Exclude URL starting with "/my-page/"', 'wplingua' ); ?></li> |
| 54 |
<li><code>/my-page/$</code> - <?php esc_html_e( 'Exclude URL ending with "/my-page/"', 'wplingua' ); ?></li> |
| 55 |
<li><code>/my-page/</code> - <?php esc_html_e( 'Exclude URL containing "/my-page/"', 'wplingua' ); ?></li> |
| 56 |
</ul> |
| 57 |
<br> |
| 58 |
<textarea name="wplng_excluded_url" id="wplng_excluded_url" rows="6"><?php echo esc_textarea( get_option( 'wplng_excluded_url' ) ); ?></textarea> |
| 59 |
</fieldset> |
| 60 |
</td> |
| 61 |
</tr> |
| 62 |
</table> |
| 63 |
|
| 64 |
<?php submit_button(); ?> |
| 65 |
|
| 66 |
</form> |
| 67 |
</div> |
| 68 |
<?php |
| 69 |
} |
| 70 |
|