| @@ -53,26 +53,8 @@ | ||
| 53 | 53 | */ |
| 54 | 54 | protected $td_style = ''; |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | - * Cell padding. | |
| 58 | - * | |
| 59 | - * @since 6.25 | |
| 60 | - * | |
| 61 | - * @var string | |
| 62 | - */ | |
| 63 | - protected $cell_padding = '7px 9px'; | |
| 64 | - | |
| 65 | - /** | |
| 66 | - * Table width. | |
| 67 | - * | |
| 68 | - * @since 6.25 | |
| 69 | - * | |
| 70 | - * @var string | |
| 71 | - */ | |
| 72 | - protected $width = ''; | |
| 73 | - | |
| 74 | - /** | |
| 75 | 57 | * Used to add a class in tables. Set in Pro. |
| 76 | 58 | * |
| 77 | 59 | * @var bool |
| 78 | 60 | * @since 5.4.2 |
| @@ -87,17 +69,8 @@ | ||
| 87 | 69 | */ |
| 88 | 70 | public function __construct( $type, $atts = array() ) { |
| 89 | 71 | |
| 90 | 72 | $this->type = (string) $type; |
| 91 | - | |
| 92 | - if ( isset( $atts['cell_padding'] ) ) { | |
| 93 | - $this->cell_padding = $atts['cell_padding']; | |
| 94 | - } | |
| 95 | - | |
| 96 | - if ( isset( $atts['width'] ) ) { | |
| 97 | - $this->width = $atts['width']; | |
| 98 | - } | |
| 99 | - | |
| 100 | 73 | $this->init_style_settings( $atts ); |
| 101 | 74 | $this->init_use_inline_style( $atts ); |
| 102 | 75 | $this->init_direction( $atts ); |
| 103 | 76 | $this->init_table_style(); |
| @@ -132,9 +105,9 @@ | ||
| 132 | 105 | $this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] ); |
| 133 | 106 | } |
| 134 | 107 | } |
| 135 | 108 | |
| 136 | - $this->style_settings['class'] = $atts['class'] ?? ''; | |
| 109 | + $this->style_settings['class'] = isset( $atts['class'] ) ? $atts['class'] : ''; | |
| 137 | 110 | } |
| 138 | 111 | |
| 139 | 112 | /** |
| 140 | 113 | * Set the use_inline_style property |
| @@ -172,9 +145,9 @@ | ||
| 172 | 145 | */ |
| 173 | 146 | private function init_table_style() { |
| 174 | 147 | if ( $this->use_inline_style === true ) { |
| 175 | 148 | |
| 176 | - $this->table_style = ' style="' . esc_attr( 'border-spacing:0;font-size:' . $this->style_settings['font_size'] . ';line-height:135%;' ); | |
| 149 | + $this->table_style = ' style="' . esc_attr( 'font-size:' . $this->style_settings['font_size'] . ';line-height:135%;' ); | |
| 177 | 150 | $this->table_style .= esc_attr( 'border-bottom:' . $this->style_settings['border_width'] . ' solid ' . $this->style_settings['border_color'] . ';' ) . '"'; |
| 178 | 151 | |
| 179 | 152 | } |
| 180 | 153 | |
| @@ -180,12 +153,8 @@ | ||
| 180 | 153 | |
| 181 | 154 | if ( ! empty( $this->style_settings['class'] ) ) { |
| 182 | 155 | $this->table_style .= ' class="' . esc_attr( $this->style_settings['class'] ) . '"'; |
| 183 | 156 | } |
| 184 | - | |
| 185 | - if ( ! empty( $this->width ) ) { | |
| 186 | - $this->table_style .= ' width="' . esc_attr( $this->width ) . '"'; | |
| 187 | - } | |
| 188 | 157 | } |
| 189 | 158 | |
| 190 | 159 | /** |
| 191 | 160 | * Set the td_style property |
| @@ -196,36 +165,16 @@ | ||
| 196 | 165 | private function init_td_style() { |
| 197 | 166 | if ( $this->use_inline_style === true ) { |
| 198 | 167 | |
| 199 | 168 | $td_style_attributes = 'text-align:' . ( $this->direction === 'rtl' ? 'right' : 'left' ) . ';'; |
| 200 | - $td_style_attributes .= 'color:' . $this->style_settings['text_color'] . ';padding:' . $this->cell_padding . ';vertical-align:top;'; | |
| 169 | + $td_style_attributes .= 'color:' . $this->style_settings['text_color'] . ';padding:7px 9px;vertical-align:top;'; | |
| 201 | 170 | $td_style_attributes .= 'border-top:' . $this->style_settings['border_width'] . ' solid ' . $this->style_settings['border_color'] . ';'; |
| 202 | 171 | |
| 203 | - $this->td_style = ' style="' . esc_attr( $td_style_attributes ) . '"'; | |
| 172 | + $this->td_style = ' style="' . $td_style_attributes . '"'; | |
| 204 | 173 | } |
| 205 | 174 | } |
| 206 | 175 | |
| 207 | 176 | /** |
| 208 | - * Removes border CSS from HTML. | |
| 209 | - * | |
| 210 | - * @since 6.25 | |
| 211 | - * | |
| 212 | - * @param string $html The HTML. | |
| 213 | - * @param string $position The border position. Default is `top`. | |
| 214 | - * @return string | |
| 215 | - */ | |
| 216 | - public function remove_border( $html, $position = 'top' ) { | |
| 217 | - $search = sprintf( | |
| 218 | - 'border-%1$s:%2$s solid %3$s;', | |
| 219 | - $position, | |
| 220 | - $this->style_settings['border_width'], | |
| 221 | - $this->style_settings['border_color'] | |
| 222 | - ); | |
| 223 | - | |
| 224 | - return str_replace( $search, '', $html ); | |
| 225 | - } | |
| 226 | - | |
| 227 | - /** | |
| 228 | 177 | * Determine if setting is for a color, e.g. text color, background color, or border color |
| 229 | 178 | * |
| 230 | 179 | * @since 2.05 |
| 231 | 180 | * @param string $setting_key Name of setting. |
| @@ -270,13 +219,12 @@ | ||
| 270 | 219 | * Get the table row style |
| 271 | 220 | * |
| 272 | 221 | * @since 2.04 |
| 273 | 222 | * @since 5.0.16 Changed scope from `private` to `protected`. |
| 274 | - * @since 6.25 Changed scope from `protected` to `public`. | |
| 275 | 223 | * |
| 276 | 224 | * @return string |
| 277 | 225 | */ |
| 278 | - public function tr_style() { | |
| 226 | + protected function tr_style() { | |
| 279 | 227 | |
| 280 | 228 | if ( $this->type === 'shortcode' ) { |
| 281 | 229 | $tr_style = ' style="[frm-alt-color]"'; |
| 282 | 230 | } elseif ( $this->use_inline_style ) { |
| @@ -285,30 +233,8 @@ | ||
| 285 | 233 | $tr_style = ''; |
| 286 | 234 | } |
| 287 | 235 | |
| 288 | 236 | return $tr_style; |
| 289 | - } | |
| 290 | - | |
| 291 | - /** | |
| 292 | - * Gets table style. | |
| 293 | - * | |
| 294 | - * @since 6.25 | |
| 295 | - * | |
| 296 | - * @return string | |
| 297 | - */ | |
| 298 | - public function get_table_style() { | |
| 299 | - return $this->table_style; | |
| 300 | - } | |
| 301 | - | |
| 302 | - /** | |
| 303 | - * Gets td style. | |
| 304 | - * | |
| 305 | - * @since 6.25 | |
| 306 | - * | |
| 307 | - * @return string | |
| 308 | - */ | |
| 309 | - public function get_td_style() { | |
| 310 | - return $this->td_style; | |
| 311 | 237 | } |
| 312 | 238 | |
| 313 | 239 | /** |
| 314 | 240 | * Switch the odd property from true to false or false to true |