Completed
Branch FET/extra-logging-when-trashin... (b6e112)
by
unknown
36:04 queued 27:41
created
core/db_models/fields/EE_Full_HTML_Field.php 1 patch
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -14,57 +14,57 @@
 block discarded – undo
14 14
 class EE_Full_HTML_Field extends EE_Text_Field_Base
15 15
 {
16 16
 
17
-    /**
18
-     * @param string $table_column
19
-     * @param string $nicename
20
-     * @param bool   $nullable
21
-     * @param null   $default_value
22
-     */
23
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
24
-    {
25
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
26
-        $this->setSchemaType('object');
27
-    }
17
+	/**
18
+	 * @param string $table_column
19
+	 * @param string $nicename
20
+	 * @param bool   $nullable
21
+	 * @param null   $default_value
22
+	 */
23
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
24
+	{
25
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
26
+		$this->setSchemaType('object');
27
+	}
28 28
 
29 29
 
30
-    /**
31
-     * Does shortcodes and auto-paragraphs the content (unless schema is 'no_wpautop')
32
-     *
33
-     * @param type $value_on_field_to_be_outputted
34
-     * @param type $schema
35
-     * @return string
36
-     */
37
-    public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
38
-    {
39
-        if ($schema == 'form_input') {
40
-            return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
41
-        } elseif ($schema == 'no_wpautop') {
42
-            return do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema));
43
-        } else {
44
-            return wpautop(do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema)));
45
-        }
46
-    }
30
+	/**
31
+	 * Does shortcodes and auto-paragraphs the content (unless schema is 'no_wpautop')
32
+	 *
33
+	 * @param type $value_on_field_to_be_outputted
34
+	 * @param type $schema
35
+	 * @return string
36
+	 */
37
+	public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
38
+	{
39
+		if ($schema == 'form_input') {
40
+			return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
41
+		} elseif ($schema == 'no_wpautop') {
42
+			return do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema));
43
+		} else {
44
+			return wpautop(do_shortcode(parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema)));
45
+		}
46
+	}
47 47
 
48 48
 
49 49
 
50
-    public function getSchemaProperties()
51
-    {
52
-        return array(
53
-            'raw' => array(
54
-                'description' =>  sprintf(
55
-                    __('%s - the value in the database.', 'event_espresso'),
56
-                    $this->get_nicename()
57
-                ),
58
-                'type' => 'string'
59
-            ),
60
-            'rendered' => array(
61
-                'description' =>  sprintf(
62
-                    __('%s - transformed for display.', 'event_espresso'),
63
-                    $this->get_nicename()
64
-                ),
65
-                'type' => 'string',
66
-                'readonly' => true
67
-            )
68
-        );
69
-    }
50
+	public function getSchemaProperties()
51
+	{
52
+		return array(
53
+			'raw' => array(
54
+				'description' =>  sprintf(
55
+					__('%s - the value in the database.', 'event_espresso'),
56
+					$this->get_nicename()
57
+				),
58
+				'type' => 'string'
59
+			),
60
+			'rendered' => array(
61
+				'description' =>  sprintf(
62
+					__('%s - transformed for display.', 'event_espresso'),
63
+					$this->get_nicename()
64
+				),
65
+				'type' => 'string',
66
+				'readonly' => true
67
+			)
68
+		);
69
+	}
70 70
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_DB_Only_Int_Field.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,15 +2,15 @@
 block discarded – undo
2 2
 
3 3
 class EE_DB_Only_Int_Field extends EE_DB_Only_Field_Base
4 4
 {
5
-    /**
6
-     * @param string $table_column
7
-     * @param string $nicename
8
-     * @param bool   $nullable
9
-     * @param null   $default_value
10
-     */
11
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
12
-    {
13
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
14
-        $this->setSchemaType('integer');
15
-    }
5
+	/**
6
+	 * @param string $table_column
7
+	 * @param string $nicename
8
+	 * @param bool   $nullable
9
+	 * @param null   $default_value
10
+	 */
11
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
12
+	{
13
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
14
+		$this->setSchemaType('integer');
15
+	}
16 16
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Enum_Integer_Field.php 2 patches
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -9,114 +9,114 @@
 block discarded – undo
9 9
  */
10 10
 class EE_Enum_Integer_Field extends EE_Integer_Field
11 11
 {
12
-    /**
13
-     * @var array $_allowed_enum_values
14
-     */
15
-    public $_allowed_enum_values;
12
+	/**
13
+	 * @var array $_allowed_enum_values
14
+	 */
15
+	public $_allowed_enum_values;
16 16
 
17 17
 
18
-    /**
19
-     * @param string  $table_column
20
-     * @param string  $nicename
21
-     * @param boolean $nullable
22
-     * @param int     $default_value
23
-     * @param array   $allowed_enum_values keys are values to be used in the DB, values are how they should be displayed
24
-     */
25
-    public function __construct($table_column, $nicename, $nullable, $default_value, $allowed_enum_values)
26
-    {
27
-        $this->_allowed_enum_values = $allowed_enum_values;
28
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
29
-        $this->setSchemaType('object');
30
-    }
18
+	/**
19
+	 * @param string  $table_column
20
+	 * @param string  $nicename
21
+	 * @param boolean $nullable
22
+	 * @param int     $default_value
23
+	 * @param array   $allowed_enum_values keys are values to be used in the DB, values are how they should be displayed
24
+	 */
25
+	public function __construct($table_column, $nicename, $nullable, $default_value, $allowed_enum_values)
26
+	{
27
+		$this->_allowed_enum_values = $allowed_enum_values;
28
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
29
+		$this->setSchemaType('object');
30
+	}
31 31
 
32
-    /**
33
-     * Returns the list of allowed enum options, but filterable.
34
-     * This is used internally
35
-     *
36
-     * @return array
37
-     */
38
-    protected function _allowed_enum_values()
39
-    {
40
-        return (array) apply_filters(
41
-            'FHEE__EE_Enum_Integer_Field___allowed_enum_options',
42
-            $this->_allowed_enum_values,
43
-            $this
44
-        );
45
-    }
32
+	/**
33
+	 * Returns the list of allowed enum options, but filterable.
34
+	 * This is used internally
35
+	 *
36
+	 * @return array
37
+	 */
38
+	protected function _allowed_enum_values()
39
+	{
40
+		return (array) apply_filters(
41
+			'FHEE__EE_Enum_Integer_Field___allowed_enum_options',
42
+			$this->_allowed_enum_values,
43
+			$this
44
+		);
45
+	}
46 46
 
47
-    /**
48
-     * When setting, just verify that the value being used matches what we've defined as allowable enum values.
49
-     * If not, throw an error (but if WP_DEBUG is false, just set the value to default)
50
-     *
51
-     * @param int $value_inputted_for_field_on_model_object
52
-     * @return int
53
-     * @throws EE_Error
54
-     */
55
-    public function prepare_for_set($value_inputted_for_field_on_model_object)
56
-    {
57
-        $allowed_enum_values = $this->_allowed_enum_values();
58
-        if ($value_inputted_for_field_on_model_object !== null
59
-            && ! array_key_exists($value_inputted_for_field_on_model_object, $allowed_enum_values)
60
-        ) {
61
-            if (defined('WP_DEBUG') && WP_DEBUG) {
62
-                $msg = sprintf(
63
-                    __('System is assigning incompatible value "%1$s" to field "%2$s"', 'event_espresso'),
64
-                    $value_inputted_for_field_on_model_object,
65
-                    $this->_name
66
-                );
67
-                $msg2 = sprintf(
68
-                    __('Allowed values for "%1$s" are "%2$s". You provided "%3$s"', 'event_espresso'),
69
-                    $this->_name,
70
-                    implode(', ', array_keys($allowed_enum_values)),
71
-                    $value_inputted_for_field_on_model_object
72
-                );
73
-                EE_Error::add_error("{$msg}||{$msg2}", __FILE__, __FUNCTION__, __LINE__);
74
-            }
75
-            return $this->get_default_value();
76
-        }
77
-        return (int) $value_inputted_for_field_on_model_object;
78
-    }
47
+	/**
48
+	 * When setting, just verify that the value being used matches what we've defined as allowable enum values.
49
+	 * If not, throw an error (but if WP_DEBUG is false, just set the value to default)
50
+	 *
51
+	 * @param int $value_inputted_for_field_on_model_object
52
+	 * @return int
53
+	 * @throws EE_Error
54
+	 */
55
+	public function prepare_for_set($value_inputted_for_field_on_model_object)
56
+	{
57
+		$allowed_enum_values = $this->_allowed_enum_values();
58
+		if ($value_inputted_for_field_on_model_object !== null
59
+			&& ! array_key_exists($value_inputted_for_field_on_model_object, $allowed_enum_values)
60
+		) {
61
+			if (defined('WP_DEBUG') && WP_DEBUG) {
62
+				$msg = sprintf(
63
+					__('System is assigning incompatible value "%1$s" to field "%2$s"', 'event_espresso'),
64
+					$value_inputted_for_field_on_model_object,
65
+					$this->_name
66
+				);
67
+				$msg2 = sprintf(
68
+					__('Allowed values for "%1$s" are "%2$s". You provided "%3$s"', 'event_espresso'),
69
+					$this->_name,
70
+					implode(', ', array_keys($allowed_enum_values)),
71
+					$value_inputted_for_field_on_model_object
72
+				);
73
+				EE_Error::add_error("{$msg}||{$msg2}", __FILE__, __FUNCTION__, __LINE__);
74
+			}
75
+			return $this->get_default_value();
76
+		}
77
+		return (int) $value_inputted_for_field_on_model_object;
78
+	}
79 79
 
80 80
 
81 81
 
82
-    /**
83
-     * Gets the pretty version of the enum's value.
84
-     *
85
-     * @param int | string $value_on_field_to_be_outputted
86
-     * @param null         $schema
87
-     * @return string
88
-     */
89
-    public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
90
-    {
91
-        $options = $this->_allowed_enum_values();
92
-        if (isset($options[ $value_on_field_to_be_outputted ])) {
93
-            return $options[ $value_on_field_to_be_outputted ];
94
-        } else {
95
-            return $value_on_field_to_be_outputted;
96
-        }
97
-    }
82
+	/**
83
+	 * Gets the pretty version of the enum's value.
84
+	 *
85
+	 * @param int | string $value_on_field_to_be_outputted
86
+	 * @param null         $schema
87
+	 * @return string
88
+	 */
89
+	public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
90
+	{
91
+		$options = $this->_allowed_enum_values();
92
+		if (isset($options[ $value_on_field_to_be_outputted ])) {
93
+			return $options[ $value_on_field_to_be_outputted ];
94
+		} else {
95
+			return $value_on_field_to_be_outputted;
96
+		}
97
+	}
98 98
 
99 99
 
100
-    public function getSchemaProperties()
101
-    {
102
-        return array(
103
-            'raw' => array(
104
-                'description' =>  sprintf(
105
-                    __('%s - the value in the database.', 'event_espresso'),
106
-                    $this->get_nicename()
107
-                ),
108
-                'enum' => array_keys($this->_allowed_enum_values()),
109
-                'type' => 'integer'
110
-            ),
111
-            'pretty' => array(
112
-                'description' =>  sprintf(
113
-                    __('%s - the value for display.', 'event_espresso'),
114
-                    $this->get_nicename()
115
-                ),
116
-                'enum' => array_values($this->_allowed_enum_values()),
117
-                'type' => 'string',
118
-                'read_only' => true
119
-            )
120
-        );
121
-    }
100
+	public function getSchemaProperties()
101
+	{
102
+		return array(
103
+			'raw' => array(
104
+				'description' =>  sprintf(
105
+					__('%s - the value in the database.', 'event_espresso'),
106
+					$this->get_nicename()
107
+				),
108
+				'enum' => array_keys($this->_allowed_enum_values()),
109
+				'type' => 'integer'
110
+			),
111
+			'pretty' => array(
112
+				'description' =>  sprintf(
113
+					__('%s - the value for display.', 'event_espresso'),
114
+					$this->get_nicename()
115
+				),
116
+				'enum' => array_values($this->_allowed_enum_values()),
117
+				'type' => 'string',
118
+				'read_only' => true
119
+			)
120
+		);
121
+	}
122 122
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@
 block discarded – undo
89 89
     public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
90 90
     {
91 91
         $options = $this->_allowed_enum_values();
92
-        if (isset($options[ $value_on_field_to_be_outputted ])) {
93
-            return $options[ $value_on_field_to_be_outputted ];
92
+        if (isset($options[$value_on_field_to_be_outputted])) {
93
+            return $options[$value_on_field_to_be_outputted];
94 94
         } else {
95 95
             return $value_on_field_to_be_outputted;
96 96
         }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Maybe_Serialized_Text_Field.php 1 patch
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -2,36 +2,36 @@
 block discarded – undo
2 2
 
3 3
 class EE_Maybe_Serialized_Text_Field extends EE_Serialized_Text_Field
4 4
 {
5
-    /**
6
-     * Value could be an array or a string. If its an array, serialize it. Otherwise, leave it as a string
7
-     *
8
-     * @param array|string $value_of_field_on_model_object
9
-     * @return string (possibly serialized)
10
-     */
11
-    public function prepare_for_use_in_db($value_of_field_on_model_object)
12
-    {
13
-        if (is_array($value_of_field_on_model_object)) {
14
-            return parent::prepare_for_use_in_db($value_of_field_on_model_object);
15
-        } else {
16
-            return $value_of_field_on_model_object;
17
-        }
18
-    }
5
+	/**
6
+	 * Value could be an array or a string. If its an array, serialize it. Otherwise, leave it as a string
7
+	 *
8
+	 * @param array|string $value_of_field_on_model_object
9
+	 * @return string (possibly serialized)
10
+	 */
11
+	public function prepare_for_use_in_db($value_of_field_on_model_object)
12
+	{
13
+		if (is_array($value_of_field_on_model_object)) {
14
+			return parent::prepare_for_use_in_db($value_of_field_on_model_object);
15
+		} else {
16
+			return $value_of_field_on_model_object;
17
+		}
18
+	}
19 19
 
20
-    /**
21
-     * Formats the array (or string) according to $schema. Right now, just implode with commas
22
-     *
23
-     * @param type $value_on_field_to_be_outputted
24
-     * @param type $schema
25
-     * @return strubg
26
-     */
27
-    public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
28
-    {
29
-        $pretty_value = null;
30
-        if (is_array($value_on_field_to_be_outputted)) {
31
-            $pretty_value = parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
32
-        } else {
33
-            $pretty_value = $value_on_field_to_be_outputted;
34
-        }
35
-        return $pretty_value;
36
-    }
20
+	/**
21
+	 * Formats the array (or string) according to $schema. Right now, just implode with commas
22
+	 *
23
+	 * @param type $value_on_field_to_be_outputted
24
+	 * @param type $schema
25
+	 * @return strubg
26
+	 */
27
+	public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
28
+	{
29
+		$pretty_value = null;
30
+		if (is_array($value_on_field_to_be_outputted)) {
31
+			$pretty_value = parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
32
+		} else {
33
+			$pretty_value = $value_on_field_to_be_outputted;
34
+		}
35
+		return $pretty_value;
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Post_Content_Field.php 2 patches
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -7,127 +7,127 @@
 block discarded – undo
7 7
 class EE_Post_Content_Field extends EE_Text_Field_Base
8 8
 {
9 9
 
10
-    /**
11
-     * @param string $table_column
12
-     * @param string $nicename
13
-     * @param bool   $nullable
14
-     * @param null   $default_value
15
-     */
16
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
17
-    {
18
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
19
-        $this->setSchemaType('object');
20
-    }
10
+	/**
11
+	 * @param string $table_column
12
+	 * @param string $nicename
13
+	 * @param bool   $nullable
14
+	 * @param null   $default_value
15
+	 */
16
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
17
+	{
18
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
19
+		$this->setSchemaType('object');
20
+	}
21 21
 
22 22
 
23
-    /**
24
-     * removes all tags which a WP Post wouldn't allow in its content normally
25
-     *
26
-     * @param string $value
27
-     * @return string
28
-     */
29
-    public function prepare_for_set($value)
30
-    {
31
-        if (! current_user_can('unfiltered_html')) {
32
-            $value = wp_kses("$value", wp_kses_allowed_html('post'));
33
-        }
34
-        return parent::prepare_for_set($value);
35
-    }
23
+	/**
24
+	 * removes all tags which a WP Post wouldn't allow in its content normally
25
+	 *
26
+	 * @param string $value
27
+	 * @return string
28
+	 */
29
+	public function prepare_for_set($value)
30
+	{
31
+		if (! current_user_can('unfiltered_html')) {
32
+			$value = wp_kses("$value", wp_kses_allowed_html('post'));
33
+		}
34
+		return parent::prepare_for_set($value);
35
+	}
36 36
 
37 37
 
38 38
 
39
-    /**
40
-     * Runs the content through `the_content`, or if prepares the content for placing in a form input
41
-     * @param string $value_on_field_to_be_outputted
42
-     * @param string   $schema possible values: 'form_input' or null (if null, will run through 'the_content')
43
-     * @return string
44
-     * @throws EE_Error when WP_DEBUG is on and recursive calling is detected
45
-     */
46
-    public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
47
-    {
48
-        switch ($schema) {
49
-            case 'form_input':
50
-                return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
51
-            case 'the_content':
52
-                if (doing_filter('the_content')) {
53
-                    if (defined('WP_DEBUG') && WP_DEBUG) {
54
-                        throw new EE_Error(
55
-                            sprintf(
56
-                                esc_html__('You have recursively called "%1$s" with %2$s set to %3$s which uses "%2$s" filter. You should use it with %2$s "%3$s" instead here.', 'event_espresso'),
57
-                                'EE_Post_Content_Field::prepare_for_pretty_echoing',
58
-                                '$schema',
59
-                                'the_content',
60
-                                'the_content_wp_core_only'
61
-                            )
62
-                        );
63
-                    } else {
64
-                        return $this->prepare_for_pretty_echoing($value_on_field_to_be_outputted, 'the_content_wp_core_only');
65
-                    }
66
-                }
67
-                return apply_filters(
68
-                    'the_content',
69
-                    parent::prepare_for_pretty_echoing(
70
-                        $value_on_field_to_be_outputted,
71
-                        $schema
72
-                    )
73
-                );
74
-            case 'the_content_wp_core_only':
75
-            default:
76
-                self::_setup_the_content_wp_core_only_filters();
77
-                $return_value = apply_filters(
78
-                    'the_content_wp_core_only',
79
-                    parent::prepare_for_pretty_echoing(
80
-                        $value_on_field_to_be_outputted,
81
-                        $schema
82
-                    )
83
-                );
84
-                // ya know what? adding these filters is super fast. Let's just
85
-                // avoid needing to maintain global state and set this up as-needed
86
-                remove_all_filters('the_content_wp_core_only');
87
-                do_action('AHEE__EE_Post_Content_Field__prepare_for_pretty_echoing__the_content_wp_core_only__done');
88
-                return $return_value;
89
-        }
90
-    }
39
+	/**
40
+	 * Runs the content through `the_content`, or if prepares the content for placing in a form input
41
+	 * @param string $value_on_field_to_be_outputted
42
+	 * @param string   $schema possible values: 'form_input' or null (if null, will run through 'the_content')
43
+	 * @return string
44
+	 * @throws EE_Error when WP_DEBUG is on and recursive calling is detected
45
+	 */
46
+	public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
47
+	{
48
+		switch ($schema) {
49
+			case 'form_input':
50
+				return parent::prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema);
51
+			case 'the_content':
52
+				if (doing_filter('the_content')) {
53
+					if (defined('WP_DEBUG') && WP_DEBUG) {
54
+						throw new EE_Error(
55
+							sprintf(
56
+								esc_html__('You have recursively called "%1$s" with %2$s set to %3$s which uses "%2$s" filter. You should use it with %2$s "%3$s" instead here.', 'event_espresso'),
57
+								'EE_Post_Content_Field::prepare_for_pretty_echoing',
58
+								'$schema',
59
+								'the_content',
60
+								'the_content_wp_core_only'
61
+							)
62
+						);
63
+					} else {
64
+						return $this->prepare_for_pretty_echoing($value_on_field_to_be_outputted, 'the_content_wp_core_only');
65
+					}
66
+				}
67
+				return apply_filters(
68
+					'the_content',
69
+					parent::prepare_for_pretty_echoing(
70
+						$value_on_field_to_be_outputted,
71
+						$schema
72
+					)
73
+				);
74
+			case 'the_content_wp_core_only':
75
+			default:
76
+				self::_setup_the_content_wp_core_only_filters();
77
+				$return_value = apply_filters(
78
+					'the_content_wp_core_only',
79
+					parent::prepare_for_pretty_echoing(
80
+						$value_on_field_to_be_outputted,
81
+						$schema
82
+					)
83
+				);
84
+				// ya know what? adding these filters is super fast. Let's just
85
+				// avoid needing to maintain global state and set this up as-needed
86
+				remove_all_filters('the_content_wp_core_only');
87
+				do_action('AHEE__EE_Post_Content_Field__prepare_for_pretty_echoing__the_content_wp_core_only__done');
88
+				return $return_value;
89
+		}
90
+	}
91 91
 
92 92
 
93 93
 
94
-    /**
95
-     * Verifies we've setup the standard WP core filters on  'the_content_wp_core_only' filter
96
-     */
97
-    protected static function _setup_the_content_wp_core_only_filters()
98
-    {
99
-        add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'run_shortcode'), 8);
100
-        add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'autoembed'), 8);
101
-        add_filter('the_content_wp_core_only', 'wptexturize', 10);
102
-        add_filter('the_content_wp_core_only', 'wpautop', 10);
103
-        add_filter('the_content_wp_core_only', 'shortcode_unautop', 10);
104
-        add_filter('the_content_wp_core_only', 'prepend_attachment', 10);
105
-        if (function_exists('wp_make_content_images_responsive')) {
106
-            add_filter('the_content_wp_core_only', 'wp_make_content_images_responsive', 10);
107
-        }
108
-        add_filter('the_content_wp_core_only', 'do_shortcode', 11);
109
-        add_filter('the_content_wp_core_only', 'convert_smilies', 20);
110
-    }
94
+	/**
95
+	 * Verifies we've setup the standard WP core filters on  'the_content_wp_core_only' filter
96
+	 */
97
+	protected static function _setup_the_content_wp_core_only_filters()
98
+	{
99
+		add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'run_shortcode'), 8);
100
+		add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'autoembed'), 8);
101
+		add_filter('the_content_wp_core_only', 'wptexturize', 10);
102
+		add_filter('the_content_wp_core_only', 'wpautop', 10);
103
+		add_filter('the_content_wp_core_only', 'shortcode_unautop', 10);
104
+		add_filter('the_content_wp_core_only', 'prepend_attachment', 10);
105
+		if (function_exists('wp_make_content_images_responsive')) {
106
+			add_filter('the_content_wp_core_only', 'wp_make_content_images_responsive', 10);
107
+		}
108
+		add_filter('the_content_wp_core_only', 'do_shortcode', 11);
109
+		add_filter('the_content_wp_core_only', 'convert_smilies', 20);
110
+	}
111 111
 
112 112
 
113 113
 
114
-    public function getSchemaProperties()
115
-    {
116
-        return array(
117
-            'raw' => array(
118
-                'description' =>  sprintf(
119
-                    __('%s - the content as it exists in the database.', 'event_espresso'),
120
-                    $this->get_nicename()
121
-                ),
122
-                'type' => 'string'
123
-            ),
124
-            'rendered' => array(
125
-                'description' =>  sprintf(
126
-                    __('%s - the content rendered for display.', 'event_espresso'),
127
-                    $this->get_nicename()
128
-                ),
129
-                'type' => 'string'
130
-            )
131
-        );
132
-    }
114
+	public function getSchemaProperties()
115
+	{
116
+		return array(
117
+			'raw' => array(
118
+				'description' =>  sprintf(
119
+					__('%s - the content as it exists in the database.', 'event_espresso'),
120
+					$this->get_nicename()
121
+				),
122
+				'type' => 'string'
123
+			),
124
+			'rendered' => array(
125
+				'description' =>  sprintf(
126
+					__('%s - the content rendered for display.', 'event_espresso'),
127
+					$this->get_nicename()
128
+				),
129
+				'type' => 'string'
130
+			)
131
+		);
132
+	}
133 133
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function prepare_for_set($value)
30 30
     {
31
-        if (! current_user_can('unfiltered_html')) {
31
+        if ( ! current_user_can('unfiltered_html')) {
32 32
             $value = wp_kses("$value", wp_kses_allowed_html('post'));
33 33
         }
34 34
         return parent::prepare_for_set($value);
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
      */
97 97
     protected static function _setup_the_content_wp_core_only_filters()
98 98
     {
99
-        add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'run_shortcode'), 8);
100
-        add_filter('the_content_wp_core_only', array( $GLOBALS['wp_embed'], 'autoembed'), 8);
99
+        add_filter('the_content_wp_core_only', array($GLOBALS['wp_embed'], 'run_shortcode'), 8);
100
+        add_filter('the_content_wp_core_only', array($GLOBALS['wp_embed'], 'autoembed'), 8);
101 101
         add_filter('the_content_wp_core_only', 'wptexturize', 10);
102 102
         add_filter('the_content_wp_core_only', 'wpautop', 10);
103 103
         add_filter('the_content_wp_core_only', 'shortcode_unautop', 10);
Please login to merge, or discard this patch.
core/db_models/fields/EE_Maybe_Serialized_Simple_HTML_Field.php 2 patches
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -11,59 +11,59 @@
 block discarded – undo
11 11
  */
12 12
 class EE_Maybe_Serialized_Simple_HTML_Field extends EE_Maybe_Serialized_Text_Field
13 13
 {
14
-    /**
15
-     * removes all non-basic tags when setting
16
-     *
17
-     * @param string $value_inputted_for_field_on_model_object
18
-     * @return string
19
-     */
20
-    public function prepare_for_set($value_inputted_for_field_on_model_object)
21
-    {
22
-        return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object));
23
-    }
14
+	/**
15
+	 * removes all non-basic tags when setting
16
+	 *
17
+	 * @param string $value_inputted_for_field_on_model_object
18
+	 * @return string
19
+	 */
20
+	public function prepare_for_set($value_inputted_for_field_on_model_object)
21
+	{
22
+		return parent::prepare_for_set($this->_remove_tags($value_inputted_for_field_on_model_object));
23
+	}
24 24
 
25
-    /**
26
-     * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field
27
-     *
28
-     * @param array|string $value
29
-     * @return array|string
30
-     */
31
-    protected function _remove_tags($value)
32
-    {
33
-        if (is_array($value)) {
34
-            foreach ($value as $key => $v) {
35
-                $value[ $key ] = $this->_remove_tags($v);
36
-            }
37
-        } elseif (is_string($value)) {
38
-            $value = wp_kses("$value", $this->_get_allowed_tags());
39
-        }
40
-        return $value;
41
-    }
25
+	/**
26
+	 * Remove any non-"simple" html tags. @see EE_Simple_HTML_Field
27
+	 *
28
+	 * @param array|string $value
29
+	 * @return array|string
30
+	 */
31
+	protected function _remove_tags($value)
32
+	{
33
+		if (is_array($value)) {
34
+			foreach ($value as $key => $v) {
35
+				$value[ $key ] = $this->_remove_tags($v);
36
+			}
37
+		} elseif (is_string($value)) {
38
+			$value = wp_kses("$value", $this->_get_allowed_tags());
39
+		}
40
+		return $value;
41
+	}
42 42
 
43
-    /**
44
-     * In case unsafe data somehow got inserted into the database, we want to remove tags again
45
-     *
46
-     * @param array|string $value_found_in_db_for_model_object
47
-     * @return array|string
48
-     */
49
-    public function prepare_for_set_from_db($value_found_in_db_for_model_object)
50
-    {
51
-        return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object));
52
-    }
43
+	/**
44
+	 * In case unsafe data somehow got inserted into the database, we want to remove tags again
45
+	 *
46
+	 * @param array|string $value_found_in_db_for_model_object
47
+	 * @return array|string
48
+	 */
49
+	public function prepare_for_set_from_db($value_found_in_db_for_model_object)
50
+	{
51
+		return $this->_remove_tags(parent::prepare_for_set_from_db($value_found_in_db_for_model_object));
52
+	}
53 53
 
54 54
 
55
-    /**
56
-     * Determines what tags to allow in this model field
57
-     *
58
-     * @global array $allowedtags
59
-     * @return array
60
-     */
61
-    public function _get_allowed_tags()
62
-    {
63
-        return apply_filters(
64
-            'FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags',
65
-            EEH_HTML::get_simple_tags(),
66
-            $this
67
-        );
68
-    }
55
+	/**
56
+	 * Determines what tags to allow in this model field
57
+	 *
58
+	 * @global array $allowedtags
59
+	 * @return array
60
+	 */
61
+	public function _get_allowed_tags()
62
+	{
63
+		return apply_filters(
64
+			'FHEE__EE_Maybe_Serialized_Simple_HTML_Field___get_allowed_tags',
65
+			EEH_HTML::get_simple_tags(),
66
+			$this
67
+		);
68
+	}
69 69
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     {
33 33
         if (is_array($value)) {
34 34
             foreach ($value as $key => $v) {
35
-                $value[ $key ] = $this->_remove_tags($v);
35
+                $value[$key] = $this->_remove_tags($v);
36 36
             }
37 37
         } elseif (is_string($value)) {
38 38
             $value = wp_kses("$value", $this->_get_allowed_tags());
Please login to merge, or discard this patch.
core/db_models/fields/EE_DB_Only_Field_Base.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -10,28 +10,28 @@
 block discarded – undo
10 10
 abstract class EE_DB_Only_Field_Base extends EE_Model_Field_Base
11 11
 {
12 12
 
13
-    /**
14
-     * @param string $table_column
15
-     * @param string $nicename
16
-     * @param bool   $nullable
17
-     * @param null   $default_value
18
-     */
19
-    public function __construct($table_column, $nicename, $nullable, $default_value = null)
20
-    {
21
-        parent::__construct($table_column, $nicename, $nullable, $default_value);
22
-        $this->setSchemaReadOnly(true);
23
-    }
13
+	/**
14
+	 * @param string $table_column
15
+	 * @param string $nicename
16
+	 * @param bool   $nullable
17
+	 * @param null   $default_value
18
+	 */
19
+	public function __construct($table_column, $nicename, $nullable, $default_value = null)
20
+	{
21
+		parent::__construct($table_column, $nicename, $nullable, $default_value);
22
+		$this->setSchemaReadOnly(true);
23
+	}
24 24
 
25 25
 
26
-    /**
27
-     * All these children classes are for the db-only (meaning, we should select them
28
-     * on get_all queries, update, delete, and will still want to set their default value
29
-     * on inserts, but the model object won't have reference to these fields)
30
-     *
31
-     * @return boolean
32
-     */
33
-    public function is_db_only_field()
34
-    {
35
-        return true;
36
-    }
26
+	/**
27
+	 * All these children classes are for the db-only (meaning, we should select them
28
+	 * on get_all queries, update, delete, and will still want to set their default value
29
+	 * on inserts, but the model object won't have reference to these fields)
30
+	 *
31
+	 * @return boolean
32
+	 */
33
+	public function is_db_only_field()
34
+	{
35
+		return true;
36
+	}
37 37
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Foreign_Key_String_Field.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 block discarded – undo
3 3
 class EE_Foreign_Key_String_Field extends EE_Foreign_Key_Field_Base
4 4
 {
5 5
 
6
-    /**
7
-     * removes all tags when setting
8
-     *
9
-     * @param string $value_inputted_for_field_on_model_object
10
-     * @return string
11
-     */
12
-    public function prepare_for_set($value_inputted_for_field_on_model_object)
13
-    {
14
-        if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
15
-            $value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
16
-        }
17
-        return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object));
18
-    }
6
+	/**
7
+	 * removes all tags when setting
8
+	 *
9
+	 * @param string $value_inputted_for_field_on_model_object
10
+	 * @return string
11
+	 */
12
+	public function prepare_for_set($value_inputted_for_field_on_model_object)
13
+	{
14
+		if ($this->is_model_obj_of_type_pointed_to($value_inputted_for_field_on_model_object)) {
15
+			$value_inputted_for_field_on_model_object = $value_inputted_for_field_on_model_object->ID();
16
+		}
17
+		return strtoupper(wp_strip_all_tags($value_inputted_for_field_on_model_object));
18
+	}
19 19
 }
Please login to merge, or discard this patch.
core/db_models/fields/EE_Enum_Text_Field.php 2 patches
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -11,130 +11,130 @@
 block discarded – undo
11 11
 class EE_Enum_Text_Field extends EE_Text_Field_Base
12 12
 {
13 13
 
14
-    /**
15
-     * @var array $_allowed_enum_values
16
-     */
17
-    public $_allowed_enum_values;
18
-
19
-    /**
20
-     * @param string  $table_column
21
-     * @param string  $nice_name
22
-     * @param boolean $nullable
23
-     * @param mixed   $default_value
24
-     * @param array   $allowed_enum_values keys are values to be used in the DB, values are how they should be displayed
25
-     */
26
-    public function __construct($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
27
-    {
28
-        $this->_allowed_enum_values = $allowed_enum_values;
29
-        parent::__construct($table_column, $nice_name, $nullable, $default_value);
30
-        $this->setSchemaType('object');
31
-    }
32
-
33
-
34
-
35
-    /**
36
-     * Returns the list of allowed enum options, but filterable.
37
-     * This is used internally
38
-     *
39
-     * @return array
40
-     */
41
-    protected function _allowed_enum_values()
42
-    {
43
-        return apply_filters(
44
-            'FHEE__EE_Enum_Text_Field___allowed_enum_options',
45
-            $this->_allowed_enum_values,
46
-            $this
47
-        );
48
-    }
49
-
50
-
51
-
52
-    /**
53
-     * When setting, just verify that the value being used matches what we've defined as allowable enum values.
54
-     * If not, throw an error (but if WP_DEBUG is false, just set the value to default).
55
-     *
56
-     * @param string $value_inputted_for_field_on_model_object
57
-     * @return string
58
-     * @throws EE_Error
59
-     */
60
-    public function prepare_for_set($value_inputted_for_field_on_model_object)
61
-    {
62
-        if ($value_inputted_for_field_on_model_object !== null
63
-            && ! array_key_exists($value_inputted_for_field_on_model_object, $this->_allowed_enum_values())
64
-        ) {
65
-            if (defined('WP_DEBUG') && WP_DEBUG) {
66
-                $msg = sprintf(
67
-                    __('System is assigning incompatible value "%1$s" to field "%2$s"', 'event_espresso'),
68
-                    $value_inputted_for_field_on_model_object,
69
-                    $this->_name
70
-                );
71
-                $msg2 = sprintf(
72
-                    __('Allowed values for "%1$s" are "%2$s". You provided: "%3$s"', 'event_espresso'),
73
-                    $this->_name,
74
-                    implode(', ', array_keys($this->_allowed_enum_values())),
75
-                    $value_inputted_for_field_on_model_object
76
-                );
77
-                EE_Error::add_error("{$msg}||{$msg2}", __FILE__, __FUNCTION__, __LINE__);
78
-            }
79
-            return $this->get_default_value();
80
-        }
81
-        return $value_inputted_for_field_on_model_object;
82
-    }
83
-
84
-
85
-    /**
86
-     * Gets the pretty version of the enum's value.
87
-     *
88
-     * @param     int |string $value_on_field_to_be_outputted
89
-     * @param    null         $schema
90
-     * @return    string
91
-     */
92
-    public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
93
-    {
94
-        $options = $this->_allowed_enum_values();
95
-        if (isset($options[ $value_on_field_to_be_outputted ])) {
96
-            return $options[ $value_on_field_to_be_outputted ];
97
-        } else {
98
-            return $value_on_field_to_be_outputted;
99
-        }
100
-    }
101
-
102
-
103
-
104
-    /**
105
-     * When retrieving something from the DB, don't enforce the enum's options. If it's in the DB, we just have to live
106
-     * with that. Note also: when we're saving to the DB again, we also don't enforce the enum options. It's ONLY
107
-     * when we're receiving USER input from prepare_for_set() that we enforce the enum options.
108
-     *
109
-     * @param mixed $value_in_db
110
-     * @return mixed
111
-     */
112
-    public function prepare_for_set_from_db($value_in_db)
113
-    {
114
-        return $value_in_db;
115
-    }
116
-
117
-
118
-    public function getSchemaProperties()
119
-    {
120
-        return array(
121
-            'raw' => array(
122
-                'description' =>  sprintf(
123
-                    __('%s - the value in the database.', 'event_espresso'),
124
-                    $this->get_nicename()
125
-                ),
126
-                'type' => 'string',
127
-                'enum' => array_keys($this->_allowed_enum_values)
128
-            ),
129
-            'pretty' => array(
130
-                'description' =>  sprintf(
131
-                    __('%s - the value for display.', 'event_espresso'),
132
-                    $this->get_nicename()
133
-                ),
134
-                'type' => 'string',
135
-                'enum' => array_values($this->_allowed_enum_values),
136
-                'read_only' => true
137
-            )
138
-        );
139
-    }
14
+	/**
15
+	 * @var array $_allowed_enum_values
16
+	 */
17
+	public $_allowed_enum_values;
18
+
19
+	/**
20
+	 * @param string  $table_column
21
+	 * @param string  $nice_name
22
+	 * @param boolean $nullable
23
+	 * @param mixed   $default_value
24
+	 * @param array   $allowed_enum_values keys are values to be used in the DB, values are how they should be displayed
25
+	 */
26
+	public function __construct($table_column, $nice_name, $nullable, $default_value, $allowed_enum_values)
27
+	{
28
+		$this->_allowed_enum_values = $allowed_enum_values;
29
+		parent::__construct($table_column, $nice_name, $nullable, $default_value);
30
+		$this->setSchemaType('object');
31
+	}
32
+
33
+
34
+
35
+	/**
36
+	 * Returns the list of allowed enum options, but filterable.
37
+	 * This is used internally
38
+	 *
39
+	 * @return array
40
+	 */
41
+	protected function _allowed_enum_values()
42
+	{
43
+		return apply_filters(
44
+			'FHEE__EE_Enum_Text_Field___allowed_enum_options',
45
+			$this->_allowed_enum_values,
46
+			$this
47
+		);
48
+	}
49
+
50
+
51
+
52
+	/**
53
+	 * When setting, just verify that the value being used matches what we've defined as allowable enum values.
54
+	 * If not, throw an error (but if WP_DEBUG is false, just set the value to default).
55
+	 *
56
+	 * @param string $value_inputted_for_field_on_model_object
57
+	 * @return string
58
+	 * @throws EE_Error
59
+	 */
60
+	public function prepare_for_set($value_inputted_for_field_on_model_object)
61
+	{
62
+		if ($value_inputted_for_field_on_model_object !== null
63
+			&& ! array_key_exists($value_inputted_for_field_on_model_object, $this->_allowed_enum_values())
64
+		) {
65
+			if (defined('WP_DEBUG') && WP_DEBUG) {
66
+				$msg = sprintf(
67
+					__('System is assigning incompatible value "%1$s" to field "%2$s"', 'event_espresso'),
68
+					$value_inputted_for_field_on_model_object,
69
+					$this->_name
70
+				);
71
+				$msg2 = sprintf(
72
+					__('Allowed values for "%1$s" are "%2$s". You provided: "%3$s"', 'event_espresso'),
73
+					$this->_name,
74
+					implode(', ', array_keys($this->_allowed_enum_values())),
75
+					$value_inputted_for_field_on_model_object
76
+				);
77
+				EE_Error::add_error("{$msg}||{$msg2}", __FILE__, __FUNCTION__, __LINE__);
78
+			}
79
+			return $this->get_default_value();
80
+		}
81
+		return $value_inputted_for_field_on_model_object;
82
+	}
83
+
84
+
85
+	/**
86
+	 * Gets the pretty version of the enum's value.
87
+	 *
88
+	 * @param     int |string $value_on_field_to_be_outputted
89
+	 * @param    null         $schema
90
+	 * @return    string
91
+	 */
92
+	public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
93
+	{
94
+		$options = $this->_allowed_enum_values();
95
+		if (isset($options[ $value_on_field_to_be_outputted ])) {
96
+			return $options[ $value_on_field_to_be_outputted ];
97
+		} else {
98
+			return $value_on_field_to_be_outputted;
99
+		}
100
+	}
101
+
102
+
103
+
104
+	/**
105
+	 * When retrieving something from the DB, don't enforce the enum's options. If it's in the DB, we just have to live
106
+	 * with that. Note also: when we're saving to the DB again, we also don't enforce the enum options. It's ONLY
107
+	 * when we're receiving USER input from prepare_for_set() that we enforce the enum options.
108
+	 *
109
+	 * @param mixed $value_in_db
110
+	 * @return mixed
111
+	 */
112
+	public function prepare_for_set_from_db($value_in_db)
113
+	{
114
+		return $value_in_db;
115
+	}
116
+
117
+
118
+	public function getSchemaProperties()
119
+	{
120
+		return array(
121
+			'raw' => array(
122
+				'description' =>  sprintf(
123
+					__('%s - the value in the database.', 'event_espresso'),
124
+					$this->get_nicename()
125
+				),
126
+				'type' => 'string',
127
+				'enum' => array_keys($this->_allowed_enum_values)
128
+			),
129
+			'pretty' => array(
130
+				'description' =>  sprintf(
131
+					__('%s - the value for display.', 'event_espresso'),
132
+					$this->get_nicename()
133
+				),
134
+				'type' => 'string',
135
+				'enum' => array_values($this->_allowed_enum_values),
136
+				'read_only' => true
137
+			)
138
+		);
139
+	}
140 140
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,8 +89,8 @@
 block discarded – undo
89 89
     public function prepare_for_pretty_echoing($value_on_field_to_be_outputted, $schema = null)
90 90
     {
91 91
         $options = $this->_allowed_enum_values();
92
-        if (isset($options[ $value_on_field_to_be_outputted ])) {
93
-            return $options[ $value_on_field_to_be_outputted ];
92
+        if (isset($options[$value_on_field_to_be_outputted])) {
93
+            return $options[$value_on_field_to_be_outputted];
94 94
         } else {
95 95
             return $value_on_field_to_be_outputted;
96 96
         }
Please login to merge, or discard this patch.