-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwp-plugin.php
More file actions
70 lines (61 loc) · 2.41 KB
/
Copy pathwp-plugin.php
File metadata and controls
70 lines (61 loc) · 2.41 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Plugin Name: Branded Social Images
* Description: The simplest way to brand your social images. Provide all your social images (Open Graph Images) with your brand en text. In just a few clicks.
* Plugin URI: https://github.com/acato-plugins/branded-social-images
* Author: Acato
* Author URI: https://acato.nl
* Version: 1.2.2
* License: GPL2
*/
/**
* Note from the developers.
*
* We know the plugin code is not perfect. There is a lot of room for improvement, but in our
* enthusiasm to share this with you, we could not wait for everything to be polished.
*
* We hope you like it and please, encourage others to use the plugin as well.
*
* Found bugs? Need help?
* Please visit the WordPress support page;
* @see: https://wordpress.org/support/plugin/branded-social-images/
*
* The code ain't pretty. I know.
* Want to help clean it up?
* Want to help improve?
*
* Please visit the GitHub page for this plugin;
* @see: https://github.com/acato-plugins/branded-social-images/
*/
/**
* Feature wishlist:
* 1. Better settings handler and all settings filterable for mass rollout or embedding in themes
* 2. Positioning of text and logo as well as logo scaling and font-size done "on image"
* 3. Title builder (like Yoast SEO)
* 4. Code refactoring
*/
use Clearsite\Plugins\OGImage\Plugin;
define('BSI_PLUGIN_FILE', __FILE__);
require_once __DIR__ . '/lib/inc.functions.php';
require_once __DIR__ . '/lib/class.og-image-plugin.php';
require_once __DIR__ . '/lib/class.og-image-admin.php';
add_action('plugins_loaded', [Plugin::class, 'init']);
/**
* This will fix the "You are not allowed to upload to this post" error when in admin settings.
* This only happens occasionally, most often on Gutenberg enabled WP sites, but once it happens, it keeps happening.
*/
add_action('check_ajax_referer', function ($action) {
if ('media-form' === $action && !empty($_REQUEST['action']) && 'upload-attachment' === $_REQUEST['action'] && isset($_REQUEST['post_id']) && empty($_REQUEST['post_id'])) {
unset($_REQUEST['post_id']);
}
});
/**
* plugin activation/deactivation/uninstall hooks
*/
register_activation_hook(BSI_PLUGIN_FILE, [Plugin::class, 'on_activation']);
register_deactivation_hook(BSI_PLUGIN_FILE, [Plugin::class, 'on_deactivation']);
register_uninstall_hook(BSI_PLUGIN_FILE, [Plugin::class, 'on_uninstall']);
/**
* Reference list
* @see https://www.cssscript.com/color-picker-alpha-selection/
*/