-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.php
41 lines (37 loc) · 1.2 KB
/
plugin.php
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
<?php
/**
* Plugin Name: Image Compare Block
* Description: <strong>Image Compare Block</strong> is a custom Gutenberg Block developed with Gutenberg Native Components to showcase images comparision.
* Author: Zakaria Binsaifullah
* Author URI: https://makegutenblock.com/
* Version: 1.0.0
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
*
* @package BCB
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Block Initializer.
*/
require_once plugin_dir_path( __FILE__ ) . 'src/init.php';
require_once plugin_dir_path( __FILE__ ) . 'admin/admin.php';
// Plugin Action Link
function icgb_admin_settings_link( $links ) {
$new_link = array(
'<a href="'. esc_url( 'https://makegutenblock.com/contact/' ) .'" target="_blank" style="color: #A11637; font-weight: 600">Contact</a>'
);
return array_merge( $new_link, $links );
}
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'icgb_admin_settings_link' );
// Redirecting
function icgb_user_redirecting( $plugin ) {
if( plugin_basename(__FILE__) == $plugin ){
wp_redirect( admin_url( 'tools.php?page=icgb-image-compare' ) );
die();
}
}
add_action( 'activated_plugin', 'icgb_user_redirecting' );