PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.41
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.41
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
fluent-boards / vendor / wpfluent / framework / src / WPFluent / Support / Util.php

Util.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.41, at vendor/wpfluent/framework/src/WPFluent/Support/Util.php

69 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\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 /**
59 * Get the user locale.
60 *
61 * @param int|null $userId
62 * @return \FluentBoards\Framework\Support\UserLocale
63 */
64 public static function getLocale($userId = null)
65 {
66 return Locale::init($userId);
67 }
68 }
69