PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.4.2
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.4.2
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / admin / views / sp-framework / functions / helpers.php

helpers.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 2.4.2, at admin/views/sp-framework/functions/helpers.php

78 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Helpers.
4 *
5 * @package post-carousel
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die; } // Cannot access directly.
10
11 if ( ! function_exists( 'spf_array_search' ) ) {
12 /**
13 *
14 * Array search key & value
15 *
16 * @since 1.0.0
17 * @version 1.0.0
18 *
19 * @param array $array search array.
20 * @param string $key the array key.
21 * @param mixed $value The array value.
22 *
23 * @return $results
24 */
25 function spf_array_search( $array, $key, $value ) {
26
27 $results = array();
28
29 if ( is_array( $array ) ) {
30 if ( isset( $array[ $key ] ) && $array[ $key ] == $value ) {
31 $results[] = $array;
32 }
33
34 foreach ( $array as $sub_array ) {
35 $results = array_merge( $results, spf_array_search( $sub_array, $key, $value ) );
36 }
37 }
38
39 return $results;
40
41 }
42 }
43
44 if ( ! function_exists( 'spf_pcp_microtime' ) ) {
45 /**
46 * Between microtime.
47 *
48 * @since 1.0.0
49 *
50 * @param integer $timenow Current time.
51 * @param integer $starttime Starting time.
52 * @param integer $timeout Time out.
53 * @return boolean
54 */
55 function sps_pcp_timeout( $timenow, $starttime, $timeout = 30 ) {
56
57 return ( ( $timenow - $starttime ) < $timeout ) ? true : false;
58
59 }
60 }
61
62 if ( ! function_exists( 'spf_wp_editor_api' ) ) {
63 /**
64 *
65 * Check for wp editor api
66 *
67 * @since 1.0.0
68 * @version 1.0.0
69 */
70 function spf_wp_editor_api() {
71
72 global $wp_version;
73
74 return version_compare( $wp_version, '4.8', '>=' );
75
76 }
77 }
78