PluginProbe
Cool Timeline (Horizontal & Vertical Timeline) / trunk
Cool Timeline (Horizontal & Vertical Timeline) vtrunk
3.4.0 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 2.2.3 2.3.3 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.6.1 2.7.1 2.8.3 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 All 79 releases
cool-timeline / admin / codestar-framework / functions / helpers.php

helpers.php in Cool Timeline (Horizontal & Vertical Timeline) trunk, at admin/codestar-framework/functions/helpers.php

62 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) { die; } // Cannot access directly.
2 /**
3 *
4 * Array search key & value
5 *
6 * @since 1.0.0
7 * @version 1.0.0
8 *
9 */
10 if ( ! function_exists( 'csf_array_search' ) ) {
11 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
12 function csf_array_search( $array, $key, $value ) {
13
14 $results = array();
15
16 if ( is_array( $array ) ) {
17 if ( isset( $array[$key] ) && $array[$key] == $value ) {
18 $results[] = $array;
19 }
20
21 foreach ( $array as $sub_array ) {
22 $results = array_merge( $results, csf_array_search( $sub_array, $key, $value ) );
23 }
24
25 }
26
27 return $results;
28
29 }
30 }
31
32 /**
33 *
34 * Between Microtime
35 *
36 * @since 1.0.0
37 * @version 1.0.0
38 *
39 */
40 if ( ! function_exists( 'csf_timeout' ) ) {
41 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
42 function csf_timeout( $timenow, $starttime, $timeout = 30 ) {
43 return ( ( $timenow - $starttime ) < $timeout ) ? true : false;
44 }
45 }
46
47 /**
48 *
49 * Check for wp editor api
50 *
51 * @since 1.0.0
52 * @version 1.0.0
53 *
54 */
55 if ( ! function_exists( 'csf_wp_editor_api' ) ) {
56 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
57 function csf_wp_editor_api() {
58 global $wp_version;
59 return version_compare( $wp_version, '4.8', '>=' );
60 }
61 }
62