PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 1.3.1
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v1.3.1
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
templately / core / class-helper.php

class-helper.php in Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! 1.3.1, at core/class-helper.php

51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Templately;
3
4 class Helper {
5 /**
6 * Get installed WordPress Plugin List
7 * @return void
8 */
9 public static function get_plugins(){
10 if( ! function_exists( 'get_plugins' ) ) {
11 require_once \ABSPATH . 'wp-admin/includes/plugin.php';
12 }
13 return \get_plugins();
14 }
15 /**
16 * Get views for front-end display
17 *
18 * @param string $name it will be file name only from the views folder.
19 * @param mixed $data
20 * @return void
21 */
22 public static function views( $name, $data = null ){
23 $helper = self::class;
24 $file = TEMPLATELY_PATH . $name . '.php';
25 if( \is_readable( $file ) ) {
26 include_once $file;
27 }
28 }
29 /**
30 * Send JSON Error
31 *
32 * @param mixed $data
33 * @param int $status_code
34 * @return void
35 */
36 public static function send_error( $data = null, $status_code = null ) {
37 \wp_send_json_error( $data, $status_code );
38 \wp_die();
39 }
40 /**
41 * Send JSON Success
42 *
43 * @param mixed $data
44 * @param int $status_code
45 * @return void
46 */
47 public static function send_success( $data = null, $status_code = null ) {
48 \wp_send_json_success( $data, $status_code );
49 \wp_die();
50 }
51 }