From 035853510dfd596cce22ae90c94eb84fa73a2f12 Mon Sep 17 00:00:00 2001 From: faisal-alvi Date: Fri, 17 Jun 2022 17:20:51 +0530 Subject: [PATCH 1/2] fix/135 Re-adding "Sqare" Crop ability --- assets/js/simple-local-avatars.js | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/js/simple-local-avatars.js b/assets/js/simple-local-avatars.js index 0d5548d3..a20effc0 100644 --- a/assets/js/simple-local-avatars.js +++ b/assets/js/simple-local-avatars.js @@ -364,6 +364,7 @@ function simple_local_avatar_calculate_image_select_options(attachment, controll y1, x2: xInit + x1, y2: yInit + y1, + aspectRatio: `${xInit}:${yInit}`, }; } From 8f4864ffe3086b667ea168c5f76360ec5e6880bd Mon Sep 17 00:00:00 2001 From: faisal-alvi Date: Wed, 22 Jun 2022 15:18:10 +0530 Subject: [PATCH 2/2] fix/135 updating the text from "Skip crop" to "Default Crop" --- includes/class-simple-local-avatars.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/class-simple-local-avatars.php b/includes/class-simple-local-avatars.php index 0d3bd46e..0a2cdb1c 100644 --- a/includes/class-simple-local-avatars.php +++ b/includes/class-simple-local-avatars.php @@ -99,6 +99,7 @@ public function __construct() { * Register actions and filters. */ public function add_hooks() { + global $pagenow; add_filter( 'plugin_action_links_' . SLA_PLUGIN_BASENAME, array( $this, 'plugin_filter_action_links' ) ); @@ -133,6 +134,14 @@ public function add_hooks() { add_filter( 'avatar_defaults', array( $this, 'add_avatar_default_field' ) ); add_action( 'wpmu_new_blog', array( $this, 'set_defaults' ) ); + + if ( 'profile.php' === $pagenow ) { + add_filter( 'media_view_strings', function ( $strings ) { + $strings['skipCropping'] = esc_html__( 'Default Crop', 'simple-local-avatars' ); + + return $strings; + }, 10, 1 ); + } } /**