-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-whatsapp-chat.php
54 lines (43 loc) · 1.49 KB
/
open-whatsapp-chat.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
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Plugin Name: Open WhatsApp Chat
* Plugin URI: https://github.com/brasawp/open-whatsapp-chat/
* Description: Add a simple button to open WhatsApp chat
* Version: 1.0.2
* Author: Brasa
* Author URI: https://brasa.art.br
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: open-whatsapp-chat
* Domain Path: /languages/
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
*/
define( 'OWC_VERSION', '1.0.2' );
define( 'OWC_FILE', __FILE__ );
if ( ! class_exists( 'Open_WhatsApp_Chat' ) ) {
include_once dirname( OWC_FILE ) . '/includes/class-open-whatsapp-chat.php';
add_action( 'init', 'owc_load_plugin_textdomain' );
add_action( 'plugin_action_links_' . plugin_basename( OWC_FILE ), 'owc_add_plugin_action_links', 10, 5 );
}
/**
* Load the plugin text domain for translation.
*/
function owc_load_plugin_textdomain() {
load_plugin_textdomain( 'open-whatsapp-chat', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
/**
* Add link to Settings on plugin action links
*/
function owc_add_plugin_action_links( $links ) {
$links = array_merge( array(
'<a href="' . esc_url( admin_url( '/options-general.php?page=open-whatsapp-chat' ) ) . '">' . __( 'Settings', 'open-whatsapp-chat' ) . '</a>'
), $links );
return $links;
}