Skip to content

Commit

Permalink
fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
linusx committed Feb 21, 2024
1 parent a0e6082 commit b679979
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions includes/core/classes/class-event.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function get_display_datetime(): string {
$timezone = $settings->get_value( 'general', 'formatting', 'show_timezone' ) ? ' T' : '';

// If there is a user and they have custom date/time formats, use those.
if ($user_id) {
if ( $user_id ) {
$date_format = get_user_meta( $user_id, 'gp_date_format', true ) ?? $date_format;
$time_format = get_user_meta( $user_id, 'gp_time_format', true ) ?? $time_format;
}
Expand Down Expand Up @@ -557,8 +557,8 @@ public function get_datetime(): array {
global $wpdb;

// Get the users timezone from the profile.
$user_id = get_current_user_id();
$gp_timezone = esc_attr( get_user_meta( $user_id, 'gp_timezone', true ) );
$user_id = get_current_user_id();
$gp_timezone = esc_attr( get_user_meta( $user_id, 'gp_timezone', true ) );

$default = array(
'datetime_start' => '',
Expand All @@ -584,8 +584,8 @@ public function get_datetime(): array {
}

// If not in an admin page, use the user's timezone if set.
if ( ! is_admin() && $user_id && !empty( $gp_timezone ) ) {
$data['timezone'] = !empty( $gp_timezone ) ? $gp_timezone : $data['timezone'];
if ( ! is_admin() && $user_id && ! empty( $gp_timezone ) ) {
$data['timezone'] = ! empty( $gp_timezone ) ? $gp_timezone : $data['timezone'];
}

return array_merge(
Expand Down
40 changes: 20 additions & 20 deletions includes/templates/admin/user/date-time.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
return;
}

$tz_choices = Utility::timezone_choices();
$gatherpress_tz_choices = Utility::timezone_choices();

$date_attrs = array(
$gatherpress_date_attrs = array(
'name' => 'gp_date_format',
'value' => ! empty( $date_format ) ? $date_format : '',
);

$time_attrs = array(
$gatherpress_time_attrs = array(
'name' => 'gp_time_format',
'value' => ! empty( $time_format ) ? $time_format : '',
);
Expand All @@ -29,52 +29,52 @@
<?php esc_html_e( 'Date & Time Formatting', 'gatherpress' ); ?>
</h2>
<div>
<?php _e( 'For more information read the <a href="https://wordpress.org/documentation/article/customize-date-and-time-format/">Documentation on date and time formatting</a>.', 'gatherpress' ); ?>
<?php esc_html_e( 'For more information read the <a href="https://wordpress.org/documentation/article/customize-date-and-time-format/">Documentation on date and time formatting</a>.', 'gatherpress' ); ?>
</div>
<table class="form-table">
<tr>
<th scope="row"><label for="gp_date_format"><?php _e( 'Date Format', 'gatherpress' ); ?></label></th>
<th scope="row"><label for="gp_date_format"><?php esc_html_e( 'Date Format', 'gatherpress' ); ?></label></th>
<td>
<div class="form-wrap">
<label for="gp_date_format"><?php _e('Format of date for scheduled events.', 'gatherpress'); ?></label>
<label for="gp_date_format"><?php esc_html_e( 'Format of date for scheduled events.', 'gatherpress' ); ?></label>
<input type="text" name="gp_date_format" id="gp_date_format" value="<?php echo esc_attr( $date_format ); ?>" />
<p>
<strong><?php _e( 'Preview', 'gatherpress' ); ?>:</strong>
<span data-gp_component_name="datetime-preview" data-gp_component_attrs="<?php echo esc_attr( htmlspecialchars( wp_json_encode( $date_attrs ), ENT_QUOTES, 'UTF-8' ) ); ?>"></span>
<strong><?php esc_html_e( 'Preview', 'gatherpress' ); ?>:</strong>
<span data-gp_component_name="datetime-preview" data-gp_component_attrs="<?php echo esc_attr( htmlspecialchars( wp_json_encode( $gatherpress_date_attrs ), ENT_QUOTES, 'UTF-8' ) ); ?>"></span>
</p>
</div>
</td>
</tr>
<tr>
<th>
<label for="gp_time_format"><?php _e( 'Time Format', 'gatherpress' ); ?></label></th>
<label for="gp_time_format"><?php esc_html_e( 'Time Format', 'gatherpress' ); ?></label></th>
<td>
<div class="form-wrap">
<label for="gp_date_format"><?php _e('Format of time for scheduled events.', 'gatherpress'); ?></label>
<label for="gp_date_format"><?php esc_html_e( 'Format of time for scheduled events.', 'gatherpress' ); ?></label>
<input type="text" name="gp_time_format" id="gp_time_format" value="<?php echo esc_attr( $time_format ); ?>" />
<p>
<strong><?php _e( 'Preview', 'gatherpress' ); ?>:</strong>
<span data-gp_component_name="datetime-preview" data-gp_component_attrs="<?php echo esc_attr( htmlspecialchars( wp_json_encode( $time_attrs ), ENT_QUOTES, 'UTF-8' ) ); ?>"></span>
<strong><?php esc_html_e( 'Preview', 'gatherpress' ); ?>:</strong>
<span data-gp_component_name="datetime-preview" data-gp_component_attrs="<?php echo esc_attr( htmlspecialchars( wp_json_encode( $gatherpress_time_attrs ), ENT_QUOTES, 'UTF-8' ) ); ?>"></span>
</p>
</div>
</td>
</tr>
<tr>
<th><label for="gp_timezone"><?php _e( 'Timezone', 'gatherpress' ); ?></label></th>
<th><label for="gp_timezone"><?php esc_html_e( 'Timezone', 'gatherpress' ); ?></label></th>
<td>
<select name="gp_timezone">
<option value="">--</option>
<?php
foreach( $tz_choices as $location => $timezones ) {
echo '<optgroup label="' . $location . '">';
foreach( $timezones as $tz => $name ) {
echo '<option value="' . $tz . '"';
if ($timezone === $tz) {
foreach ( $gatherpress_tz_choices as $gatherpress_location => $gatherpress_timezones ) {
echo esc_html( '<optgroup label="' . $gatherpress_location . '">' );
foreach ( $gatherpress_timezones as $gatherpress_tz => $gatherpress_name ) {
echo esc_html( '<option value="' . $gatherpress_tz . '"' );
if ( $timezone === $gatherpress_tz ) {
echo ' selected';
}
echo '>' . $name . '</option>';
echo esc_html( '>' . $gatherpress_name . '</option>' );
}
echo '</optgroup>';
echo esc_html( '</optgroup>' );
}
?>
</select>
Expand Down
2 changes: 1 addition & 1 deletion src/components/RsvpResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const RsvpResponse = () => {
'Not Attending',
'responded not attending',
'gatherpress'
)
)
: __("Didn't Go", 'gatherpress'),
value: 'not_attending',
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/RsvpResponseCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const RsvpResponseCard = ({ value, limit, responses = [] }) => {
? __(
'No one is attending this event yet.',
'gatherpress'
)
)
: __('No one went to this event.', 'gatherpress')}
</div>
)}
Expand Down

0 comments on commit b679979

Please sign in to comment.