Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace _e usage #2071

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletions admin/tpl/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,31 @@
<img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-gear.png' ); ?>" class="icon-gear" width="26" height="26">
<img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-front.png' ); ?>" class="icon-front" width="50" height="43">
</span>
<h1><?php _e( 'SiteOrigin Widgets Bundle', 'so-widgets-bundle' ); ?></h1>
<h1>
<?php echo esc_html__( 'SiteOrigin Widgets Bundle', 'so-widgets-bundle' ); ?>
</h1>

<div id="sow-widget-search">
<input type="search" placeholder="<?php esc_attr_e( 'Filter Widgets', 'so-widgets-bundle' ); ?>" />
</div>
</div>

<ul class="page-nav">
<li class="active"><a href="#all"><?php _e( 'All', 'so-widgets-bundle' ); ?></a></li>
<li><a href="#enabled"><?php _e( 'Enabled', 'so-widgets-bundle' ); ?></a></li>
<li><a href="#disabled"><?php _e( 'Disabled', 'so-widgets-bundle' ); ?></a></li>
<li class="active">
<a href="#all">
<?php echo esc_html__( 'All', 'so-widgets-bundle' ); ?>
</a>
</li>
<li>
<a href="#enabled">
<?php echo esc_html__( 'Enabled', 'so-widgets-bundle' ); ?>
</a>
</li>
<li>
<a href="#disabled">
<?php echo esc_html__( 'Disabled', 'so-widgets-bundle' ); ?>
</a>
</li>
</ul>


Expand Down Expand Up @@ -46,7 +60,9 @@

<div class="so-widget-text">

<div class="so-widget-active-indicator"><?php _e( 'Active', 'so-widgets-bundle' ); ?></div>
<div class="so-widget-active-indicator">
<?php echo esc_html__( 'Active', 'so-widgets-bundle' ); ?>
</div>

<h3><?php echo esc_html( $widget['Name'] ); ?></h3>

Expand Down Expand Up @@ -75,11 +91,11 @@
<?php if ( empty( $widget['HideActivate'] ) ) { ?>
<div class="so-widget-toggle-active">
<button class="button-secondary so-widget-activate" data-status="1">
<?php esc_html_e( 'Activate', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Activate', 'so-widgets-bundle' ); ?>
</button>

<button class="button-secondary so-widget-deactivate" data-status="0">
<?php esc_html_e( 'Deactivate', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Deactivate', 'so-widgets-bundle' ); ?>
</button>
</div>
<?php } ?>
Expand All @@ -102,15 +118,15 @@

?>
<button class="button-secondary so-widget-settings" data-form-url="<?php echo esc_url( $form_url ); ?>">
<?php esc_html_e( 'Settings', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Settings', 'so-widgets-bundle' ); ?>
</button>
<?php
}
?>

<?php if ( ! empty( $widget['Documentation'] ) ) { ?>
<a href="<?php echo esc_url( $widget['Documentation'] ); ?>" target="_blank" rel="noopener noreferrer" class="so-widget-documentation">
<?php _e( 'Documentation', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Documentation', 'so-widgets-bundle' ); ?>
</a>
<?php } ?>
</div>
Expand All @@ -125,7 +141,7 @@
<?php if ( ! class_exists( 'SiteOrigin_Panels' ) || ! class_exists( 'SiteOrigin_Premium' ) ) { ?>
<div class="installer">
<a href="#" class="installer-link">
<?php _e( 'General Widget Bundle Settings', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'General Widget Bundle Settings', 'so-widgets-bundle' ); ?>
</a>

<div class="installer-container" style="display: none;">
Expand All @@ -145,15 +161,19 @@ class="installer_status"


<div class="developers-link">
<?php _e( 'Developers - create your own widgets for the Widgets Bundle.', 'so-widgets-bundle' ); ?>
<a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank" rel="noopener noreferrer"><?php _e( 'Read More', 'so-widgets-bundle' ); ?></a>.
<?php echo esc_html__( 'Developers - create your own widgets for the Widgets Bundle.', 'so-widgets-bundle' ); ?>
<a href="https://siteorigin.com/docs/widgets-bundle/" target="_blank" rel="noopener noreferrer">
<?php echo esc_html__( 'Read More', 'so-widgets-bundle' ); ?>
</a>.
</div>

<div id="sow-settings-dialog">
<div class="so-overlay"></div>

<div class="so-title-bar">
<h3 class="so-title"><?php _e( 'Widget Settings', 'so-widgets-bundle' ); ?></h3>
<h3 class="so-title">
<?php echo esc_html__( 'Widget Settings', 'so-widgets-bundle' ); ?>
</h3>
<a class="so-close" tabindex="0">
<span class="so-dialog-icon"></span>
</a>
Expand All @@ -165,7 +185,7 @@ class="installer_status"
<div class="so-toolbar">
<div class="so-buttons">
<button class="button-primary so-save" tabindex="0">
<?php _e( 'Save', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Save', 'so-widgets-bundle' ); ?>
</button>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion base/inc/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ function siteorigin_widget_preview_widget_action() {
?>
<html>
<head>
<title><?php _e( 'Widget Preview', 'so-widgets-bundle' ); ?></title>
<title>
<?php echo esc_html( 'Widget Preview', 'so-widgets-bundle' ); ?>
</title>
<?php
wp_print_scripts();
wp_print_styles();
Expand Down
11 changes: 5 additions & 6 deletions base/inc/fields/date-range.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,17 @@ private function render_specific_date_selector() {
?>
<div class="sowb-specific-date-after">
<span>
<?php
_ex( 'From', 'From this date', 'so-widgets-bundle' );
?>

<?php
echo esc_html_x( 'From', 'From this date', 'so-widgets-bundle' );
?>
</span>
<input type="text" class="datepicker after-picker"/>
</div>

<div class="sowb-specific-date-before">
<span>
<?php
_e( 'to', 'so-widgets-bundle' );
echo esc_html__( 'to', 'so-widgets-bundle' );
?>
</span>
<input type="text" class="datepicker before-picker"/>
Expand Down Expand Up @@ -87,7 +86,7 @@ private function render_relative_date_selector_part( $name, $label, $value ) {
</option>
<?php } ?>
</select>
<span><?php _e( 'ago', 'so-widgets-bundle' ); ?></span>
<span><?php echo esc_html__( 'ago', 'so-widgets-bundle' ); ?></span>
</div>
<?php
}
Expand Down
5 changes: 4 additions & 1 deletion base/inc/fields/icon.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ protected function render_field( $value, $instance ) {
}
?>
</div>
<label><?php _e( 'Choose Icon', 'so-widgets-bundle' ); ?></label>
<label>
<?php echo esc_html__( 'Choose Icon', 'so-widgets-bundle' ); ?>

</label>
</div>

<a class="so-icon-remove" style="display: <?php echo ! empty( $value ) ? 'inline-block' : 'none'; ?>;" tabindex="0"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ); ?></a>
Expand Down
6 changes: 3 additions & 3 deletions base/inc/fields/image-size.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function render_after_field( $value, $instance ) {

<div class="custom-size-wrapper">
<label>
<?php _e( 'Width', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Width', 'so-widgets-bundle' ); ?>
<input
type="number"
value="<?php echo esc_attr( $width ); ?>"
Expand All @@ -94,7 +94,7 @@ class="custom-image-size custom-image-size-width siteorigin-widget-input"
</label>

<label>
<?php _e( 'Height', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Height', 'so-widgets-bundle' ); ?>
<input
type="number"
value="<?php echo esc_attr( $height ); ?>"
Expand All @@ -105,7 +105,7 @@ class="custom-image-size custom-image-size-height siteorigin-widget-input"

<?php if ( ! empty( $this->custom_size_enforce ) ) { ?>
<label>
<?php _e( 'Enforce Dimensions', 'so-widgets-bundle' ); ?>
<?php echo esc_html__( 'Enforce Dimensions', 'so-widgets-bundle' ); ?>
<input
type="checkbox"
<?php checked( ! empty( $enforce ) ); ?>
Expand Down
4 changes: 3 additions & 1 deletion base/inc/fields/media.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ public function image_search_dialog() {
<div class="so-widgets-dialog-overlay"></div>

<div class="so-widgets-toolbar">
<h3><?php _e( 'Search For Images', 'so-widgets-bundle' ); ?></h3>
<h3>
<?php echo esc_html__( 'Search For Images', 'so-widgets-bundle' ); ?>
</h3>
<div class="close" tabindex="0"><span class="dashicons dashicons-no-alt"></span></div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion base/inc/fields/presets.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class="siteorigin-widget-input"
<?php } ?>
<?php } ?>
</select>
<a href="#" class="sowb-presets-field-undo"><?php _e( 'Undo', 'so-widgets-bundle' ); ?></a>
<a href="#" class="sowb-presets-field-undo">
<?php echo esc_html__( 'Undo', 'so-widgets-bundle' ); ?>
</a>
<?php
}

Expand Down
6 changes: 3 additions & 3 deletions base/inc/widgets/base-slider.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,18 @@ class="sow-slider-images"
?>
<ol class="sow-slider-pagination">
<?php foreach ( $frames as $i => $frame ) { ?>
<li><a href="#" data-goto="<?php echo (int) $i; ?>" aria-label="<?php printf( __( 'display slide %s', 'so-widgets-bundle' ), (int) $i + 1 ); ?>"></a></li>
<li><a href="#" data-goto="<?php echo (int) $i; ?>" aria-label="<?php printf( esc_attr__( 'Display slide %s', 'so-widgets-bundle' ), (int) $i + 1 ); ?>"></a></li>
<?php } ?>
</ol>

<div class="sow-slide-nav sow-slide-nav-next">
<a href="#" data-goto="next" aria-label="<?php _e( 'next slide', 'so-widgets-bundle' ); ?>" data-action="next">
<a href="#" data-goto="next" aria-label="<?php echo esc_attr__( 'Next slide', 'so-widgets-bundle' ); ?>" data-action="next">
<em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ); ?>-right"></em>
</a>
</div>

<div class="sow-slide-nav sow-slide-nav-prev">
<a href="#" data-goto="previous" aria-label="<?php _e( 'previous slide', 'so-widgets-bundle' ); ?>" data-action="prev">
<a href="#" data-goto="previous" aria-label="<?php echo esc_attr__( 'Previous slide', 'so-widgets-bundle' ); ?>" data-action="prev">
<em class="sow-sld-icon-<?php echo sanitize_html_class( $controls['nav_style'] ); ?>-left"></em>
</a>
</div>
Expand Down
20 changes: 15 additions & 5 deletions base/siteorigin-widget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,16 @@ public function form( $instance, $form_type = 'widget' ) {

<?php if ( $this->show_preview_button() ) { ?>
<div class="siteorigin-widget-preview" style="display: none">
<a href="#" class="siteorigin-widget-preview-button button-secondary"><?php _e( 'Preview', 'so-widgets-bundle' ); ?></a>
<a href="#" class="siteorigin-widget-preview-button button-secondary">
<?php echo esc_html__( 'Preview', 'so-widgets-bundle' ); ?>
</a>
</div>
<?php } ?>

<?php if ( ! empty( $this->widget_options['help'] ) ) { ?>
<a href="<?php echo sow_esc_url( $this->widget_options['help'] ); ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Help', 'so-widgets-bundle' ); ?></a>
<a href="<?php echo sow_esc_url( $this->widget_options['help'] ); ?>" class="siteorigin-widget-help-link siteorigin-panels-help-link" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Help', 'so-widgets-bundle' ); ?>
</a>
<?php } ?>

<script type="text/javascript">
Expand Down Expand Up @@ -584,8 +588,12 @@ public function display_siteorigin_premium_teaser() {

public function scripts_loading_message() {
?>
<p><strong><?php _e( 'This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'so-widgets-bundle' ); ?></strong></p>
<p><strong><?php _e( 'You will only need to do this once.', 'so-widgets-bundle' ); ?></strong></p>
<p>
<strong><?php echo esc_html__( 'This widget has scripts and styles that need to be loaded before you can use it. Please save and reload your current page.', 'so-widgets-bundle' ); ?></strong>
</p>
<p>
<strong><?php echo esc_html__( 'You will only need to do this once.', 'so-widgets-bundle' ); ?></strong>
</p>
<?php
}

Expand Down Expand Up @@ -687,7 +695,9 @@ public function footer_admin_templates() {
<div class="so-widgets-dialog-overlay"></div>

<div class="so-widgets-toolbar">
<h3><?php _e( 'Widget Preview', 'so-widgets-bundle' ); ?></h3>
<h3>
<?php echo esc_html__( 'Widget Preview', 'so-widgets-bundle' ); ?>
</h3>
<div class="close" tabindex="0"><span class="dashicons dashicons-arrow-left-alt2"></span></div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions widgets/contact/tpl/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<label
class="sow-form-field-label-<?php echo esc_attr( $instance['design']['labels']['position'] != 'inside' ? $instance['design']['labels']['position'] : 'above' ); ?>"
for="really-simple-captcha-<?php echo esc_attr( $instance_hash ); ?>">
<strong><?php _e( 'Captcha', 'so-widgets-bundle' ); ?></strong>
<strong><?php echo esc_html__( 'Captcha', 'so-widgets-bundle' ); ?></strong>
</label>
<?php } ?>

Expand All @@ -23,7 +23,7 @@ class="sow-form-field-label-<?php echo esc_attr( $instance['design']['labels']['
</span>
<?php if ( $instance['design']['labels']['position'] == 'below' ) { ?>
<label class="sow-form-field-label-left" for="really-simple-captcha-<?php echo esc_attr( $instance_hash ); ?>">
<strong><?php _e( 'Captcha', 'so-widgets-bundle' ); ?></strong>
<strong><?php echo esc_html__( 'Captcha', 'so-widgets-bundle' ); ?></strong>
</label>
<?php } ?>
<input type="hidden" name="really-simple-captcha-prefix-<?php echo esc_attr( $instance_hash ); ?>" value="<?php echo esc_attr( $really_simple_spam_prefix ); ?>" />
Expand Down