-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew-post-type.php
More file actions
29 lines (25 loc) · 1017 Bytes
/
Copy pathnew-post-type.php
File metadata and controls
29 lines (25 loc) · 1017 Bytes
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
<?php
/**
* Plugin Name: NewPostType
* Plugin URI: https://atelier.staces.be/
* Description: Dev tools to create easily a new post type with custom fields
* Version: 3.3.1
* Author: Cedric Staces
* Author URI: https://staces.be/
* Text Domain: staces-builder-theme
*/
if (!defined('ABSPATH')) { exit; }
// Plugin activation
register_activation_hook(__FILE__, function(){ update_option('stacesbuilder_npt_activated', true); });
// Deactivating the plugin
register_deactivation_hook(__FILE__, function(){ delete_option('stacesbuilder_npt_activated'); });
require_once(__DIR__.'/custom-fields/custom-fields-manager.php');
require_once(__DIR__.'/new-post-type/cpt-registry.php');
require_once(__DIR__.'/new-post-type/setups.php');
require_once(__DIR__.'/new-post-type/npt.php');
add_action('after_setup_theme', function(){
if(has_action('npt-setup')) do_action('npt-setup');
});
add_action('init', function(){
if(has_action('cfm-setup')) do_action('cfm-setup');
}, 1000);