generated from KevinBatdorf/gutenberg-rust-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunlimited-photos.php
30 lines (28 loc) · 959 Bytes
/
unlimited-photos.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
<?php
/**
* Plugin Name: Unlimited Photos
* Description: Search millions of photos, AI-generated imagry, textures, wallpapers, and more.
* Requires at least: 5.8
* Requires PHP: 7.0
* Version: 1.5.0
* Author: Kevin Batdorf
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: unlimited-photos
*
* @package kevinbatdorf
*/
add_action('init', function () {
register_block_type(__DIR__ . '/build');
wp_set_script_translations('kevinbatdorf/unlimited-photos', 'unlimited-photos');
});
add_action('admin_enqueue_scripts', function () {
wp_add_inline_script(
'kevinbatdorf-unlimited-photos-editor-script',
'window.unlimitedPhotosConfig = ' . wp_json_encode([
// Convert to mb
'maxUploadSize' => number_format(wp_max_upload_size() / 1048576),
]),
'before'
);
});