Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated of_sanitize_font_size to latest version

  • Loading branch information...
commit 7373c905324f29728848310f4f68fe8ef38f0432 1 parent ab99ed0
Weslly H weslly authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 options-sanitize.php
10 options-sanitize.php
View
@@ -193,13 +193,13 @@ function of_sanitize_typography( $input, $option ) {
function of_sanitize_font_size( $value ) {
$recognized = of_recognized_font_sizes();
- $value = preg_replace('/px/','', $value);
- if ( in_array( (int) $value, $recognized ) ) {
- return (int) $value;
+ $value_check = preg_replace('/px/','', $value);

I think str_replace() would be better for a such simple replace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ if ( in_array( (int) $value_check, $recognized ) ) {
+ return $value;
}
- return (int) apply_filters( 'of_default_font_size', $recognized );
+ return apply_filters( 'of_default_font_size', $recognized );
}
-add_filter( 'of_font_face', 'of_sanitize_font_size' );
+add_filter( 'of_font_size', 'of_sanitize_font_size' );
function of_sanitize_font_style( $value ) {
George Mamadashvili

I think str_replace() would be better for a such simple replace.

Please sign in to comment.
Something went wrong with that request. Please try again.