-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcustom-fields.php
More file actions
57 lines (51 loc) · 1.26 KB
/
custom-fields.php
File metadata and controls
57 lines (51 loc) · 1.26 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
<?php
/**
* Plugin Name: WPify Custom Fields
* Plugin URI: https://wpify.io
* Description: Modern custom fields for WordPress
* Version: 1.0.0
* Author: WPify
* Author URI: https://wpify.io
* Text Domain: wpify-custom-fields
* Domain Path: /languages/
* Requires at least: 6.2
* Requires PHP: 8.1
* License: GPLv3 or later
*
* @package WPify Custom Fields
*/
use Wpify\CustomFields\CustomFields;
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
if ( ! function_exists( 'wpify_custom_fields' ) ) {
/**
* Gets an instance of the WCF plugin
*
* @return CustomFields
*
* phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
*/
function wpify_custom_fields(): CustomFields {
static $plugin;
if ( empty( $plugin ) ) {
$plugin = new CustomFields();
}
return $plugin;
}
}
/**
* Plugin deactivation hook.
*
* Clears the scheduled cron event for temp file cleanup.
* Only runs when the standalone plugin is deactivated,
* not when the library is used as a Composer dependency.
*/
if ( function_exists( 'register_deactivation_hook' ) ) {
register_deactivation_hook(
__FILE__,
function () {
wp_clear_scheduled_hook( 'wpifycf_cleanup_temp_files' );
}
);
}