PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.5.2
JetFormBuilder — Dynamic Blocks Form Builder v3.4.5.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / includes / classes / base-attributes-trait.php
jetformbuilder / includes / classes Last commit date
arguments 1 year ago arrayable 2 years ago filters 1 year ago http 2 years ago macro-constants 2 years ago post 1 year ago resources 1 year ago theme 2 years ago attributes-trait.php 2 years ago base-attributes-trait.php 2 years ago builder-helper.php 1 year ago compatibility.php 2 years ago date-tools.php 2 years ago gallery.php 2 years ago get-icon-trait.php 2 years ago get-template-trait.php 2 years ago html-attributes-trait.php 2 years ago instance-trait.php 2 years ago regexp-tools.php 2 years ago tools.php 1 year ago
base-attributes-trait.php
75 lines
1 <?php
2
3
4 namespace Jet_Form_Builder\Classes;
5
6 use Jet_Form_Builder\Blocks\Render\Base;
7
8 // If this file is called directly, abort.
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 trait Base_Attributes_Trait {
14
15 /**
16 * Add attribute
17 *
18 * @param $attr
19 * @param null $value
20 */
21 abstract public function add_attribute( $attr, $value = null );
22
23 /**
24 * Reset attributes array
25 */
26 abstract public function reset_attributes();
27
28 abstract public function get_all_attrs();
29
30 /**
31 * Render current attributes string
32 *
33 * @return void
34 */
35 public function render_attributes_string() {
36 $this->render_attributes_string_save();
37 $this->reset_attributes();
38 }
39
40 public function render_attributes_string_save() {
41 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
42 echo Tools::esc_template_string( $this->get_attributes_string_save() );
43 }
44
45 public function get_attributes_string_save() {
46 $response = '';
47 $attrs = $this->get_all_attrs();
48
49 if ( $this instanceof Base ) {
50 $attrs = apply_filters(
51 "jet-form-builder/render/{$this->get_name()}/attributes",
52 $attrs,
53 $this
54 );
55 }
56
57 foreach ( $attrs as $attr => $value ) {
58 if ( is_array( $value ) ) {
59 $value = implode( ' ', $value );
60 }
61 $response .= sprintf( ' %1$s="%2$s"', $attr, esc_attr( $value ) );
62 }
63
64 return $response;
65 }
66
67 public function get_attributes_string() {
68 $response = $this->get_attributes_string_save();
69 $this->reset_attributes();
70
71 return $response;
72 }
73
74 }
75