PluginProbe ʕ •ᴥ•ʔ
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings / 1.0.255
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings v1.0.255
1.0.272 1.0.271 1.0.271.1 1.0.270 1.0.269 trunk 1.0.216 1.0.217 1.0.218 1.0.219 1.0.220 1.0.221 1.0.222 1.0.223 1.0.224 1.0.225 1.0.226 1.0.227 1.0.227.1 1.0.228 1.0.229 1.0.230 1.0.231 1.0.232 1.0.233 1.0.234 1.0.234.1 1.0.235 1.0.236 1.0.237 1.0.238 1.0.239 1.0.240 1.0.241 1.0.242 1.0.243 1.0.244 1.0.245 1.0.246 1.0.247 1.0.248 1.0.249 1.0.250 1.0.251 1.0.251.1 1.0.252 1.0.252.1 1.0.253 1.0.254 1.0.255 1.0.256 1.0.257 1.0.258 1.0.259 1.0.259.1 1.0.260 1.0.261 1.0.262 1.0.263 1.0.264 1.0.264.1 1.0.265 1.0.266 1.0.266.1 1.0.267 1.0.268
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / database / class-escape.php
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / database Last commit date
class-clauses.php 2 years ago class-database.php 2 years ago class-escape.php 2 years ago class-groupby.php 2 years ago class-joins.php 2 years ago class-orderby.php 2 years ago class-query-builder.php 2 years ago class-select.php 2 years ago class-translate.php 2 years ago class-where.php 2 years ago index.php 2 years ago
class-escape.php
66 lines
1 <?php
2 /**
3 * The escape functions.
4 *
5 * @since 1.0.0
6 * @package MyThemeShop
7 * @subpackage MyThemeShop\Database
8 * @author MyThemeShop <admin@mythemeshop.com>
9 */
10
11 namespace MyThemeShop\Database;
12
13 /**
14 * Escape class.
15 */
16 trait Escape {
17
18 /**
19 * Escape array values for sql
20 *
21 * @param array $arr Array to escape.
22 *
23 * @return array
24 */
25 public function esc_array( $arr ) {
26 return array_map( array( $this, 'esc_value' ), $arr );
27 }
28
29 /**
30 * Escape value for sql
31 *
32 * @param mixed $value Value to escape.
33 *
34 * @return mixed
35 */
36 public function esc_value( $value ) {
37 global $wpdb;
38
39 if ( is_int( $value ) ) {
40 return $wpdb->prepare( '%d', $value );
41 }
42
43 if ( is_float( $value ) ) {
44 return $wpdb->prepare( '%f', $value );
45 }
46
47 return 'NULL' === $value ? $value : $wpdb->prepare( '%s', $value );
48 }
49
50 /**
51 * Escape value for like statement
52 *
53 * @codeCoverageIgnore
54 *
55 * @param string $value Value for like statement.
56 * @param string $start (Optional) The start of like query.
57 * @param string $end (Optional) The end of like query.
58 *
59 * @return string
60 */
61 public function esc_like( $value, $start = '%', $end = '%' ) {
62 global $wpdb;
63 return $start . $wpdb->esc_like( $value ) . $end;
64 }
65 }
66