-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkebbet-shortcode-footnote.php
60 lines (51 loc) · 1.51 KB
/
kebbet-shortcode-footnote.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
55
56
57
58
59
60
<?php
/**
* Plugin Name: Kebbet plugins - Shortcode for footnotes
* Plugin URI: https://github.com/kebbet/kebbet-shortcode-footnotes
* Description: Adds a shortcode that creates footnotes in the content and a footnote list at the end of the_content.
* Version: 20211005.1
* Author: Erik Betshammar
* Author URI: https://verkan.se
* Text Domain kebbet-shortcode-footnotes
* Requires at least: 5.8
* Update URI: false
*
* @package kebbet-shortcode-footnotes
* @author Erik Betshammar
*/
namespace kebbet\footnotes;
defined( 'ABSPATH' ) or exit;
/**
* Include init functions.
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/init.php';
/**
* Include helper functions.
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/helpers.php';
/**
* Include settings functions.
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/settings.php';
/**
* Include listing functions.
*/
require_once plugin_dir_path( __FILE__ ) . 'src/listing.php';
/**
* Include shortcode execution functions.
*/
require_once plugin_dir_path( __FILE__ ) . 'src/shortcode.php';
/**
* Hook into the `plugins_loaded` action
*/
function plugin_loaded() {
register();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\plugin_loaded', 0 );
/**
* Register the shortcode and filter the_content.
*/
function register() {
add_shortcode( settings\shortcode(), __NAMESPACE__ . '\shortcode\replace_content_with_sup' );
add_filter( 'the_content', __NAMESPACE__ . '\listing\display', 12 );
}