| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the raw rules editor. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
?> |
| 10 |
<p class="description"> |
| 11 |
<?php |
| 12 |
echo wp_kses( |
| 13 |
// translators: %s is a URL. |
| 14 |
sprintf( __( 'To allow copying rules between friends, <a href=%s>view the raw rules data</a>.', 'friends' ), '"#" id="toggle-raw-rules-data"' ), |
| 15 |
array( |
| 16 |
'a' => array( |
| 17 |
'href' => array(), |
| 18 |
'id' => array(), |
| 19 |
), |
| 20 |
) |
| 21 |
); |
| 22 |
?> |
| 23 |
</p> |
| 24 |
<div id="raw-rules-data" style="display: none"> |
| 25 |
<h2><?php esc_html_e( 'Raw Rules Data', 'friends' ); ?></h2> |
| 26 |
<form method="post"> |
| 27 |
<?php wp_nonce_field( 'friend-rules-raw-' . $args['friend']->user_login ); ?> |
| 28 |
<table> |
| 29 |
<tbody> |
| 30 |
<tr> |
| 31 |
<th><label for="field"><?php esc_html_e( 'Rules as JSON', 'friends' ); ?></label></th> |
| 32 |
<td> |
| 33 |
<textarea name="rules" style="font-family: monospace" rows="5" cols="80"><?php echo esc_html( json_encode( $args['rules'], JSON_PRETTY_PRINT ) ); ?></textarea> |
| 34 |
</td> |
| 35 |
</tr> |
| 36 |
</tbody> |
| 37 |
</table> |
| 38 |
<p class="submit"> |
| 39 |
<input type="submit" name="friend-rules-raw" class="button button-primary" value="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Save Changes' ); ?>"> |
| 40 |
</p> |
| 41 |
</form> |
| 42 |
</div> |
| 43 |
|