-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatrix.php
44 lines (35 loc) · 1.07 KB
/
chatrix.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
<?php
/**
* Plugin Name: Chatrix
* Description: Embed the Chatrix Matrix client into WordPress pages.
* Author: WordPress.Org Community
* Author URI: https://wordpress.org/
* Plugin URI: https://github.com/Automattic/chatrix
* Version: 0.9.1
*/
use function Automattic\Chatrix\Admin\main as adminMain;
use function Automattic\Chatrix\main;
if ( ! function_exists( 'Automattic\Chatrix\main' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
function automattic_chatrix_version(): string {
if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
// So that assets aren't cached in development environments.
return strval( time() );
}
// Do not edit this line, it's automatically set by bin/prepare-release.sh.
$version = '0.9.1';
return $version;
}
if ( is_admin() ) {
// Link to the plugin settings from the plugins page.
add_filter(
'plugin_action_links_' . plugin_basename( __FILE__ ),
function ( $links ) {
$links[] = '<a href="' . admin_url( 'options-general.php?page=chatrix' ) . '">' . __( 'Settings' ) . '</a>';
return $links;
}
);
adminMain();
}
main();