PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 1.0.92
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v1.0.92
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / vendor / wpfluent / framework / src / WPFluent / Support / Util.php

Util.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 1.0.92, at vendor/wpfluent/framework/src/WPFluent/Support/Util.php

58 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCommunity\Framework\Support;
4
5 class Util
6 {
7 /**
8 * Returns a comma-separated string or array of functions that
9 * have been called to get to the current point in code.
10 *
11 * @param string $ignoreClass
12 * @param integer $skipFrames
13 * @param boolean $pretty
14 * @return string|array
15 * @see https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/
16 */
17 public static function debugBacktraceSummary(
18 $ignoreClass = null,
19 $skipFrames = 0,
20 $pretty = true
21 ) {
22 return wp_debug_backtrace_summary(
23 $ignoreClass, $skipFrames, $pretty
24 );
25 }
26
27 /**
28 * @param string|array $value
29 * @return mixed
30 * @see https://developer.wordpress.org/reference/functions/wp_slash
31 */
32 public static function addslashes($value)
33 {
34 return wp_slash($value);
35 }
36
37 /**
38 * Convert an absolute file path to URL.
39 *
40 * @param string $filePath
41 * @return string
42 */
43 public static function pathToUrl($filePath = '')
44 {
45 if (!file_exists($filePath)) {
46 throw new \RuntimeException("File does not exist: {$filePath}");
47 }
48
49 $url = str_replace(
50 wp_normalize_path(untrailingslashit(ABSPATH)),
51 site_url(),
52 wp_normalize_path($filePath)
53 );
54
55 return esc_url_raw($url);
56 }
57 }
58