| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) or die(); |
| 3 |
/** @var \Gianism\UI\Screen $this */ |
| 4 |
/** @var \Gianism\Service\Twitter $instance */ |
| 5 |
|
| 6 |
?> |
| 7 |
|
| 8 |
<h3>X(Twitter)</h3> |
| 9 |
<table class="form-table"> |
| 10 |
<tbody> |
| 11 |
<tr> |
| 12 |
<th><label><?php printf( esc_html__( 'Connect with %s', 'wp-gianism' ), 'X' ); ?></label></th> |
| 13 |
<td> |
| 14 |
<?php $this->switch_button( 'tw_enabled', $this->option->is_enabled( 'twitter' ) ); ?> |
| 15 |
<label> |
| 16 |
<p class="description"> |
| 17 |
<?php |
| 18 |
// translators: %1$s is app name, %2$s is url. |
| 19 |
printf( __( 'You have to create %1$s App <a target="_blank" href="%2$s">here</a> to get required information.', 'wp-gianism' ), 'X', 'https://developer.x.com/apps' ); |
| 20 |
// translators: %1$s is url, %2$s is label. |
| 21 |
printf( __( 'See detail at <a href="%1$s">%2$s</a>.', 'wp-gianism' ), $this->setting_url( 'setup' ), __( 'How to set up', 'wp-gianism' ) ); |
| 22 |
?> |
| 23 |
</p> |
| 24 |
</td> |
| 25 |
</tr> |
| 26 |
<tr> |
| 27 |
<th><label for="tw_screen_name"><?php _e( 'Screen Name', 'wp-gianism' ); ?></label></th> |
| 28 |
<td><input class="regular-text" type="text" name="tw_screen_name" id="tw_screen_name" |
| 29 |
value="<?php echo esc_attr( $instance->tw_screen_name ); ?>"/></td> |
| 30 |
</tr> |
| 31 |
<tr> |
| 32 |
<th><label for="tw_consumer_key"><?php _e( 'Consumer Key', 'wp-gianism' ); ?></label></th> |
| 33 |
<td><input class="regular-text" type="text" name="tw_consumer_key" id="tw_consumer_key" |
| 34 |
value="<?php echo esc_attr( $instance->tw_consumer_key ); ?>"/></td> |
| 35 |
</tr> |
| 36 |
<tr> |
| 37 |
<th><label for="tw_consumer_secret"><?php _e( 'Consumer Secret', 'wp-gianism' ); ?></label></th> |
| 38 |
<td><input class="regular-text" type="text" name="tw_consumer_secret" id="tw_consumer_secret" |
| 39 |
value="<?php echo esc_attr( $instance->tw_consumer_secret ); ?>"/></td> |
| 40 |
</tr> |
| 41 |
<tr> |
| 42 |
<th><label for="tw_access_token"><?php _e( 'Access Token', 'wp-gianism' ); ?></label></th> |
| 43 |
<td><input class="regular-text" type="text" name="tw_access_token" id="tw_access_token" |
| 44 |
value="<?php echo esc_attr( $instance->tw_access_token ); ?>"/></td> |
| 45 |
</tr> |
| 46 |
<tr> |
| 47 |
<th><label for="tw_access_token_secret"><?php _e( 'Access token secret', 'wp-gianism' ); ?></label></th> |
| 48 |
<td><input class="regular-text" type="text" name="tw_access_token_secret" id="tw_access_token_secret" |
| 49 |
value="<?php echo esc_attr( $instance->tw_access_token_secret ); ?>"/></td> |
| 50 |
</tr> |
| 51 |
<tr> |
| 52 |
<th><label for="ggl_redirect_uri"><?php _e( 'Redirect URI', 'wp-gianism' ); ?></label></th> |
| 53 |
<td> |
| 54 |
<p class="description"> |
| 55 |
<?php |
| 56 |
$end_point = esc_url( $instance->get_redirect_endpoint() ); |
| 57 |
printf( |
| 58 |
// translators: %1$s is label, %2$s is url, %3$s is label, %4$s is url. |
| 59 |
__( 'Please set %1$s to %2$s on <a target="_blank" href="%4$s">%3$s</a>.', 'wp-gianism' ), |
| 60 |
__( 'Callback URL', 'wp-gianism' ), |
| 61 |
'<code>' . $end_point . '</code>', |
| 62 |
'X Developers', |
| 63 |
'https://developer.x.com/' |
| 64 |
); |
| 65 |
?> |
| 66 |
<a class="button" href="<?php echo esc_attr( $end_point ); ?>" |
| 67 |
onclick="window.prompt('<?php _e( 'Please copy this URL.', 'wp-gianism' ); ?>', this.href); return false;"><?php _e( 'Copy', 'wp-gianism' ); ?></a> |
| 68 |
</p> |
| 69 |
</td> |
| 70 |
</tr> |
| 71 |
<tr> |
| 72 |
<th><label><?php esc_html_e( 'X bot by Gianism', 'wp-gianism' ); ?></label></th> |
| 73 |
<td> |
| 74 |
<?php $this->switch_button( 'tw_use_cron', $instance->tw_use_cron ); ?> |
| 75 |
<p class="description"> |
| 76 |
<?php $this->new_from( '2.2' ); ?> |
| 77 |
<?php |
| 78 |
printf( |
| 79 |
// translators: %1$s, %2$s, %3$s, %4$s, %5$s are all nouns. |
| 80 |
__( 'If enabled, you can make X bot which post at the time you specified. %1$s, %2$s, %3$s, %4$s, and %5$s are required.', 'wp-gianism' ), |
| 81 |
__( 'Screen Name', 'wp-gianism' ), |
| 82 |
__( 'Consumer Key', 'wp-gianism' ), |
| 83 |
__( 'Consumer Secret', 'wp-gianism' ), |
| 84 |
__( 'Access Token', 'wp-gianism' ), |
| 85 |
__( 'Access token secret', 'wp-gianism' ) |
| 86 |
) |
| 87 |
?> |
| 88 |
</p> |
| 89 |
</td> |
| 90 |
</tr> |
| 91 |
</tbody> |
| 92 |
</table> |
| 93 |
<?php submit_button(); ?> |
| 94 |
|