-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit-embed-posts.php
More file actions
53 lines (47 loc) · 2.04 KB
/
init-embed-posts.php
File metadata and controls
53 lines (47 loc) · 2.04 KB
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: Init Embed Posts
* Plugin URI: https://inithtml.com/plugin/init-embed-posts/
* Description: Embed any WordPress post externally like a Twitter Card. No iframe, no shortcode – just pure magic.
* Version: 1.6
* Author: Init HTML
* Author URI: https://inithtml.com/
* Text Domain: init-embed-posts
* Domain Path: /languages
* Requires at least: 5.5
* Tested up to: 6.9
* Requires PHP: 7.4
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
defined( 'ABSPATH' ) || exit;
// Define constants.
define( 'INIT_PLUGIN_SUITE_IEP_VERSION', '1.6' );
define( 'INIT_PLUGIN_SUITE_IEP_SLUG', 'init-embed-posts' );
define( 'INIT_PLUGIN_SUITE_IEP_OPTION', 'init_plugin_suite_embed_posts_settings' );
define( 'INIT_PLUGIN_SUITE_IEP_NAMESPACE', 'initempo/v1' );
define( 'INIT_PLUGIN_SUITE_IEP_URL', plugin_dir_url( __FILE__ ) );
define( 'INIT_PLUGIN_SUITE_IEP_PATH', plugin_dir_path( __FILE__ ) );
define( 'INIT_PLUGIN_SUITE_IEP_ASSETS_URL', INIT_PLUGIN_SUITE_IEP_URL . 'assets/' );
define( 'INIT_PLUGIN_SUITE_IEP_ASSETS_PATH', INIT_PLUGIN_SUITE_IEP_PATH . 'assets/' );
define( 'INIT_PLUGIN_SUITE_IEP_TEMPLATES_PATH', INIT_PLUGIN_SUITE_IEP_PATH . 'templates/' );
define( 'INIT_PLUGIN_SUITE_IEP_INCLUDES_PATH', INIT_PLUGIN_SUITE_IEP_PATH . 'includes/' );
// Load includes.
require_once INIT_PLUGIN_SUITE_IEP_INCLUDES_PATH . 'rest-api.php';
require_once INIT_PLUGIN_SUITE_IEP_INCLUDES_PATH . 'embed-generator.php';
require_once INIT_PLUGIN_SUITE_IEP_INCLUDES_PATH . 'utils.php';
if ( is_admin() ) {
require_once INIT_PLUGIN_SUITE_IEP_INCLUDES_PATH . 'settings-page.php';
}
/**
* Enqueue frontend assets.
*/
function init_plugin_suite_embed_posts_enqueue_assets() {
wp_enqueue_style(
'init-embed-ui',
INIT_PLUGIN_SUITE_IEP_ASSETS_URL . 'css/style.css',
[],
INIT_PLUGIN_SUITE_IEP_VERSION
);
}
add_action( 'wp_enqueue_scripts', 'init_plugin_suite_embed_posts_enqueue_assets' );