PluginProbe
Qi Blocks / trunk
Qi Blocks vtrunk
1.5.3 1.5.2 1.5.1 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 All 45 releases
qi-blocks / inc / blocks / button / helper.php

helper.php in Qi Blocks trunk, at inc/blocks/button/helper.php

51 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Exit if accessed directly.
4 defined( 'ABSPATH' ) || exit;
5
6 if ( ! function_exists( 'qi_blocks_button_get_holder_classes' ) ) {
7 /**
8 * Function for generating add to cart button params
9 *
10 * @param array $atts - options value
11 *
12 * @return string
13 */
14 function qi_blocks_button_get_holder_classes( $atts ) {
15 $holder_classes[] = 'qi-block-button';
16 $holder_classes[] = 'qodef-block';
17 $holder_classes[] = 'qodef-m';
18 $holder_classes[] = 'qodef-html--link';
19 $holder_classes[] = ! empty( $atts['buttonLayout'] ) ? 'qodef-layout--' . $atts['buttonLayout'] : '';
20 $holder_classes[] = ! empty( $atts['buttonType'] ) ? 'qodef-type--' . $atts['buttonType'] : '';
21 $holder_classes[] = ! empty( $atts['buttonSize'] ) ? 'qodef-size--' . $atts['buttonSize'] : '';
22 $holder_classes[] = ! empty( $atts['buttonRevealHover'] ) ? 'qodef-hover--reveal qodef--' . $atts['buttonRevealHover'] : '';
23 $holder_classes[] = ! empty( $atts['buttonIconPosition'] ) ? 'qodef-icon--' . $atts['buttonIconPosition'] : '';
24 $holder_classes[] = ! empty( $atts['buttonIconHoverMove'] ) ? 'qodef-hover--icon-' . $atts['buttonIconHoverMove'] : '';
25 $holder_classes[] = ! empty( $atts['buttonIconBackgroundHoverReveal'] ) ? 'qodef-icon-background-hover--reveal qodef-icon-background-hover--' . $atts['buttonIconBackgroundHoverReveal'] : '';
26 $holder_classes[] = ! empty( $atts['buttonInnerBorderHoverType'] ) ? 'qodef-inner-border-hover--' . $atts['buttonInnerBorderHoverType'] : '';
27 $holder_classes[] = 'yes' === $atts['buttonUnderline'] ? 'qodef-text-underline' : '';
28 $holder_classes[] = ! empty( $atts['buttonUnderlineAlignment'] ) ? 'qodef-underline--' . $atts['buttonUnderlineAlignment'] : '';
29 $holder_classes[] = 'yes' === $atts['buttonUnderlineDraw'] ? 'qodef-button-underline-draw' : '';
30 $holder_classes[] = ! empty( $atts['custom_class'] ) ? $atts['custom_class'] : '';
31
32 return implode( ' ', $holder_classes );
33 }
34 }
35
36 if ( ! function_exists( 'qi_blocks_button_get_icon_classes' ) ) {
37 /**
38 * Function for generating add to cart button params
39 *
40 * @param array $atts - options value
41 *
42 * @return string
43 */
44 function qi_blocks_button_get_icon_classes( $atts ) {
45 $icon_classes[] = 'qodef-m-icon';
46 $icon_classes[] = ! empty( $atts['buttonIconColor'] ) ? 'qodef--icon-color-set' : '';
47
48 return implode( ' ', $icon_classes );
49 }
50 }
51