| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Themify Popup |
| 4 |
Plugin URI: https://themify.me/popup |
| 5 |
Version: 1.4.1 |
| 6 |
Author: Themify |
| 7 |
Description: A free plugin to display popups for ads, newsletter subscriptions, and general info. It comes with various popup styles (classic, slide-out, fullscreen, etc.). Popups can be scheduled and configured to show on certain posts, pages, categories, and user roles. |
| 8 |
Text Domain: themify-popup |
| 9 |
Domain Path: /languages |
| 10 |
Requires PHP: 7.2 |
| 11 |
Compatibility: 5.0.0 |
| 12 |
*/ |
| 13 |
|
| 14 |
defined( 'ABSPATH' ) or die( '-1' ); |
| 15 |
const THEMIFY_POPUP_VERSION='1.4.1'; |
| 16 |
/** |
| 17 |
* Bootstrap Popup plugin |
| 18 |
* |
| 19 |
* @since 1.0 |
| 20 |
*/ |
| 21 |
function themify_popup_setup() { |
| 22 |
if( ! defined( 'THEMIFY_POPUP_DIR' ) ){ |
| 23 |
define( 'THEMIFY_POPUP_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) ); |
| 24 |
} |
| 25 |
|
| 26 |
if( ! defined( 'THEMIFY_POPUP_URI' ) ){ |
| 27 |
define( 'THEMIFY_POPUP_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) ); |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
/* load Themify Metabox */ |
| 33 |
if ( ! is_file( 'themify_metabox_bootstrap' ) ) { |
| 34 |
include THEMIFY_POPUP_DIR . 'includes/themify-metabox/themify-metabox.php'; |
| 35 |
} |
| 36 |
|
| 37 |
include THEMIFY_POPUP_DIR . 'includes/system.php'; |
| 38 |
|
| 39 |
Themify_Popup::init(); |
| 40 |
} |
| 41 |
add_action( 'after_setup_theme', 'themify_popup_setup' ); |
| 42 |
|
| 43 |
function themify_popup_activate() { |
| 44 |
include trailingslashit( __DIR__ ) . 'sample/sample.php'; |
| 45 |
themify_popup_setup(); |
| 46 |
Themify_Popup::register_post_type(); |
| 47 |
flush_rewrite_rules(); |
| 48 |
} |
| 49 |
register_activation_hook( __FILE__, 'themify_popup_activate' ); |
| 50 |
add_filter( 'plugin_row_meta', 'themify_popup_plugin_meta', 10, 2 ); |
| 51 |
function themify_popup_plugin_meta( $links, $file ) { |
| 52 |
if ( plugin_basename( __FILE__ ) === $file ) { |
| 53 |
$row_meta = array( |
| 54 |
'changelogs' => '<a href="' . esc_url( 'https://themify.org/changelogs/' ) . basename( dirname( $file ) ) .'.txt" target="_blank" aria-label="' . esc_attr__( 'Plugin Changelogs', 'themify' ) . '">' . esc_html__( 'View Changelogs', 'themify' ) . '</a>' |
| 55 |
); |
| 56 |
|
| 57 |
return array_merge( $links, $row_meta ); |
| 58 |
} |
| 59 |
return (array) $links; |
| 60 |
} |
| 61 |
|