Skip to content

Commit 2fa16b4

Browse files
GambitGambit
authored andcommitted
rename functions
1 parent 17b1e9b commit 2fa16b4

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/global-settings.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ public function posts_block_columns_fix( $selectors, $tag ) {
875875
* @param String $current_css
876876
* @return String
877877
*/
878-
public static function generate_global_block_styles( $option_name, $settings_name, $defaults ) {
878+
public static function generate_global_block_layouts( $option_name, $settings_name, $defaults ) {
879879
$block_layouts = get_option( $option_name );
880880

881881
if ( ! $block_layouts || ! is_array( $block_layouts ) ) {
@@ -892,10 +892,10 @@ public static function generate_global_block_styles( $option_name, $settings_nam
892892
);
893893

894894
foreach ( $block_layouts as $property => $values ) {
895-
$states = array_filter( $values, array( 'Stackable_Global_Settings', 'get_block_style_states' ), ARRAY_FILTER_USE_KEY );
895+
$states = array_filter( $values, array( 'Stackable_Global_Settings', 'get_block_layout_states' ), ARRAY_FILTER_USE_KEY );
896896

897897
foreach ( $states as $state => $value ) {
898-
$unit = Stackable_Global_Settings::get_block_style_unit( $block_layouts, $property, $state );
898+
$unit = Stackable_Global_Settings::get_block_layout_unit( $block_layouts, $property, $state );
899899

900900
$device = strpos( $state, 'desktop' ) !== false ? 'desktop' : ( strpos( $state, 'tablet' ) !== false ? 'tablet' : 'mobile' );
901901
$hover_state = strpos( $state, 'ParentHover' ) !== false ? 'parent-hover' : ( strpos( $state, 'Hover' ) !== false ? 'hover' : 'normal' );
@@ -909,7 +909,7 @@ public static function generate_global_block_styles( $option_name, $settings_nam
909909
if ( is_string( $value ) ) {
910910
$style = $value;
911911
} else if ( is_array( $value ) ) {
912-
$default_value = Stackable_Global_Settings::get_block_style_defaults( $defaults, $property, $device );
912+
$default_value = Stackable_Global_Settings::get_block_layout_defaults( $defaults, $property, $device );
913913
$top = isset( $value[ 'top' ] ) ? $value[ 'top' ] : $default_value[ 'top' ];
914914
$right = isset( $value[ 'right' ] ) ? $value[ 'right' ] : $default_value[ 'right' ];
915915
$bottom = isset( $value[ 'bottom' ] ) ? $value[ 'bottom' ] : $default_value[ 'bottom' ];
@@ -958,15 +958,15 @@ public static function generate_global_block_styles( $option_name, $settings_nam
958958
return $generated_css;
959959
}
960960

961-
public static function get_block_style_unit( $block_styles, $property, $state ) {
962-
return $block_styles[ $property ][ $state . 'Unit' ] ?? 'px';
961+
public static function get_block_layout_unit( $block_layouts, $property, $state ) {
962+
return $block_layouts[ $property ][ $state . 'Unit' ] ?? 'px';
963963
}
964964

965-
public static function get_block_style_states( $state ) {
965+
public static function get_block_layout_states( $state ) {
966966
return strpos( $state, 'Unit' ) === false;
967967
}
968968

969-
public static function get_block_style_defaults( $defaults, $property, $device ) {
969+
public static function get_block_layout_defaults( $defaults, $property, $device ) {
970970
if ( ! isset( $defaults[ $property ] ) ) {
971971
return '';
972972
}

src/plugins/global-settings/buttons-and-icons/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function sanitize_array_setting( $input ) {
9595
public function add_global_buttons_and_icons_styles( $current_css ) {
9696
$defaults = json_decode( file_get_contents( plugin_dir_path( __FILE__ ) . 'defaults.json' ), true );
9797

98-
$generated_css = Stackable_Global_Settings::generate_global_block_styles( 'stackable_global_buttons_and_icons', 'Global Buttons and Icons', $defaults );
98+
$generated_css = Stackable_Global_Settings::generate_global_block_layouts( 'stackable_global_buttons_and_icons', 'Global Buttons and Icons', $defaults );
9999

100100
if ( ! $generated_css ) {
101101
return $current_css;

src/plugins/global-settings/spacing-and-borders/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function sanitize_array_setting( $input ) {
9696
public function add_global_spacing_and_borders_styles( $current_css ) {
9797
$defaults = json_decode( file_get_contents( plugin_dir_path( __FILE__ ) . 'defaults.json' ), true );
9898

99-
$generated_css = Stackable_Global_Settings::generate_global_block_styles( 'stackable_global_spacing_and_borders', 'Global Spacing and Borders', $defaults );
99+
$generated_css = Stackable_Global_Settings::generate_global_block_layouts( 'stackable_global_spacing_and_borders', 'Global Spacing and Borders', $defaults );
100100

101101
if ( ! $generated_css ) {
102102
return $current_css;

0 commit comments

Comments
 (0)