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

WordPress 6.6 compatibility with 2.1.6 Version Release #122

Merged
merged 4 commits into from
Jul 16, 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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** typography, fonts, custom fonts, Google Fonts, performance, privacy, full site editing, adobe fonts, GDPR
**Requires at least:** 5.0
**Tested up to:** 6.6
**Stable tag:** 2.1.5
**Stable tag:** 2.1.6
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -151,6 +151,9 @@ Yes, Custom Fonts is completely free to use, without any limitation.


## Changelog ##
### 2.1.6 ###
- Improvement: Few string from admin dashboard app doesn't have text domain support. (Props - https://github.com/pedro-mendonca)

### 2.1.5 ###
- Improved codebase for improved security.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const EditGFontVariation = (
}
) => {

const [removeTitle, setRemoveTitle] = useState("Remove");
const [addTitle, setAddTitle] = useState("Add");
const [removeTitle, setRemoveTitle] = useState( __( 'Remove', 'custom-fonts' ) );
const [addTitle, setAddTitle] = useState( __( 'Add', 'custom-fonts' ) );

useEffect(() => {
if (!disable) {
setRemoveTitle("Remove");
setAddTitle("Add");
setRemoveTitle( __( 'Remove', 'custom-fonts' ) );
setAddTitle( __( 'Add', 'custom-fonts' ) );
}
}, [disable]);

Expand Down Expand Up @@ -129,9 +129,9 @@ const EditGFontVariation = (
: "flex items-center components-button is-secondary"
}
data-font_weight={weight}
onClick={(e) => { setRemoveTitle("Adding..."); addWeight(e) }}
onClick={(e) => { setRemoveTitle( __( 'Adding...', 'custom-fonts' ) ); addWeight(e) }}
>
{addTitle === "Removing..." ? (Custom_Fonts_Icons['loadingSpinner3']) : (
{addTitle === __( 'Removing...', 'custom-fonts' ) ? (Custom_Fonts_Icons['loadingSpinner3']) : (
<span data-font_weight={weight}>
{Custom_Fonts_Icons['iconsquare']}
</span>
Expand All @@ -146,7 +146,7 @@ const EditGFontVariation = (
disabled={disable}
style={
disable
? removeTitle === "Adding..."
? removeTitle === __( 'Adding...', 'custom-fonts' )
? {
color: "#3858E9",
borderColor: "#3858E9",
Expand All @@ -160,14 +160,14 @@ const EditGFontVariation = (
: { boxShadow: "inset 0 0 0 1px" }
}
className={
removeTitle === "Adding..."
removeTitle === __( 'Adding...', 'custom-fonts' )
? "flex items-center components-button is-secondary"
: "flex text-danger items-center components-button is-secondary border border-danger"
}
data-font_weight={weight}
onClick={(e) => { setAddTitle("Removing..."); removeWeight(e) }}
onClick={(e) => { setAddTitle( __( 'Removing...', 'custom-fonts' ) ); removeWeight(e) }}
>
{removeTitle === "Adding..." ? (Custom_Fonts_Icons['loadingSpinner3']) : (
{removeTitle === __( 'Adding...', 'custom-fonts' ) ? (Custom_Fonts_Icons['loadingSpinner3']) : (
<span data-font_weight={weight}>
{Custom_Fonts_Icons['iconsquare2']}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const GFontVariation = (props) => {
const { weight, font, isInGoogleState, disable } = props;
const googleFont = useSelector( ( state ) => state.googleFont );
const dispatch = useDispatch();
const [removeTitle, setRemoveTitle] = useState("Remove");
const [addTitle, setAddTitle] = useState("Add");
const [removeTitle, setRemoveTitle] = useState( __( 'Remove', 'custom-fonts' ) );
const [addTitle, setAddTitle] = useState( __( 'Add', 'custom-fonts' ) );

useEffect(() => {
if (!disable) {
setRemoveTitle("Remove");
setAddTitle("Add");
setRemoveTitle( __( 'Remove', 'custom-fonts' ) );
setAddTitle( __( 'Add', 'custom-fonts' ) );
}
}, [disable]);

Expand Down Expand Up @@ -65,7 +65,7 @@ const GFontVariation = (props) => {
const addWeight = (e) => {
e.preventDefault();
e.stopPropagation();
setRemoveTitle("Adding...");
setRemoveTitle( __( 'Adding...', 'custom-fonts' ) );

const varWt = e.target.dataset.font_weight;
const variations = googleFont.variations;
Expand Down Expand Up @@ -94,7 +94,7 @@ const GFontVariation = (props) => {
const removeWeight = (e) => {
e.preventDefault();
e.stopPropagation();
setAddTitle("Removing...");
setAddTitle( __( 'Removing...', 'custom-fonts' ) );

const updatedVariations = googleFont.variations.filter(
(variation) => variation.font_weight !== weight
Expand Down Expand Up @@ -153,7 +153,7 @@ const GFontVariation = (props) => {
disabled={disable}
style={
disable
? addTitle === "Removing..."
? addTitle === __( 'Removing...', 'custom-fonts' )
? {
color: "#3858E9", // by removing time
borderColor: "#3858E9",
Expand All @@ -167,14 +167,14 @@ const GFontVariation = (props) => {
: { boxShadow: "inset 0 0 0 1px" }
}
className={
addTitle === "Removing..."
addTitle === __( 'Removing...', 'custom-fonts' )
? "flex text-danger items-center components-button is-secondary border border-danger"
: "flex items-center components-button is-secondary"
}
data-font_weight={weight}
onClick={addWeight}
>
{addTitle === "Removing..." ? (Custom_Fonts_Icons['loadingSpinner3']) : (
{addTitle === __( 'Removing...', 'custom-fonts' ) ? (Custom_Fonts_Icons['loadingSpinner3']) : (
<span data-font_weight={weight}>
{Custom_Fonts_Icons['iconsquare']}
</span>
Expand All @@ -189,7 +189,7 @@ const GFontVariation = (props) => {
disabled={disable}
style={
disable
? removeTitle === "Adding..."
? removeTitle === __( 'Adding...', 'custom-fonts' )
? {
color: "#3858E9",
borderColor: "#3858E9", // Updated border color
Expand All @@ -203,14 +203,14 @@ const GFontVariation = (props) => {
: { boxShadow: "inset 0 0 0 1px" }
}
className={
removeTitle === "Adding..."
removeTitle === __( 'Adding...', 'custom-fonts' )
? "flex items-center components-button is-secondary"
: "flex text-danger items-center components-button is-secondary border border-danger"
}
data-font_weight={weight}
onClick={removeWeight}
>
{removeTitle === "Adding..." ? (Custom_Fonts_Icons['loadingSpinner3']) : (
{removeTitle === __( 'Adding...', 'custom-fonts' ) ? (Custom_Fonts_Icons['loadingSpinner3']) : (
<span data-font_weight={weight}>
{Custom_Fonts_Icons['iconsquare2']}
</span>
Expand Down
Loading
Loading