forked from brainstormforce/timed-content-for-beaver-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass-bb-timed-content.php
More file actions
71 lines (58 loc) · 2 KB
/
class-bb-timed-content.php
File metadata and controls
71 lines (58 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Initiate timed content module
*
* @package timed-content-for-beaver-builder
*/
// check of BB_Timed_Content class already exist or not.
if ( ! class_exists( 'BB_Timed_Content' ) ) {
/**
* Class to check BB timeled install
*/
class BB_Timed_Content {
/**
* To initialize new object
*/
function __construct() {
add_action( 'init', array( $this, 'load_timed' ) );
add_action( 'init', array( $this, 'load_textdomain' ) );
}
/**
* Function to load BB Timed module
*/
function load_timed() {
if ( class_exists( 'FLBuilder' ) ) {
// If class exist it loads the module.
require_once 'class-timed-content-helper.php';
require_once 'timed-content-module/timed-content-module.php';
} else {
// Display admin notice for activating beaver builder.
add_action( 'admin_notices',array( $this, 'admin_notices_function' ) );
add_action( 'network_admin_notices',array( $this, 'admin_notices_function' ) );
}
}
/**
* Function to load text domain
*/
public function load_textdomain() {
load_plugin_textdomain( 'timed-content-for-beaver-builder' );
}
/**
* Function to display admin notice
*/
function admin_notices_function() {
// check for Beaver Builder Installed / Activated or not.
if ( file_exists( plugin_dir_path( 'bb-plugin-agency/fl-builder.php' ) )
|| file_exists( plugin_dir_path( 'beaver-builder-lite-version/fl-builder.php' ) ) ) {
$url = network_admin_url() . 'plugins.php?s=Beaver+Builder+Plugin';
} else {
$url = network_admin_url() . 'plugin-install.php?s=billyyoung&tab=search&type=author';
}
// To display notice.
echo '<div class="notice notice-error">';
/* Translators: Timed Content Module For Beaver Builder */
echo '<p>' . sprintf( __( 'The <strong>Timed Content Module For Beaver Builder</strong> plugin requires <strong><a href="%s">Beaver Builder</strong></a> plugin installed & activated.', 'timed-content-for-beaver-builder' ) . '</p>', $url );
echo '</div>';
}
}
}// End if().