-
Notifications
You must be signed in to change notification settings - Fork 1
/
invoiceninja.php
53 lines (45 loc) · 1.48 KB
/
invoiceninja.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
<?php
/**
* Plugin Name: Invoice Ninja
* Plugin URI: https://github.com/invoiceninja/wordpress
* Description: WordPress plugin for Invoice Ninja
* Version: 1.0.11
* Author: Invoice Ninja
* Author URI: https://invoiceninja.com
* GitHub URI: https://github.com/invoiceninja/wordpress
* Primary Branch: main
*
* License: GPLv2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
// Security check
defined( 'ABSPATH' ) or die( 'Unauthorized' );
if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) )
{
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
}
function activate_invoiceninja_plugin()
{
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'activate_invoiceninja_plugin' );
function deactivate_invoiceninja_plugin()
{
flush_rewrite_rules();
}
register_deactivation_hook( __FILE__, 'deactivate_invoiceninja_plugin' );
define( 'INVOICENINJA_DEFAULT_PRODUCT_TEMPLATE', '<a href="$page_url" class="wp-invoiceninja">
<h3 class="truncated">$product</h3>
<div class="divider"></div>
<h5 class="truncated">$description</h5>
<h5><b>$price</b></h5>
[invoiceninja_purchase product_id="$product_id"]
$image
</a>' );
define( 'INVOICENINJA_DEFAULT_IMAGE_TEMPLATE', '<figure class="wp-block-post-featured-image">
<img src="$image_url" alt="$product" decoding="async"/>
</figure>' );
if ( class_exists( 'InvoiceNinja\\Init') )
{
InvoiceNinja\Init::start();
}