-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacf-origin.php
54 lines (43 loc) · 1.36 KB
/
acf-origin.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*
Plugin Name: Origin
Plugin URI: PLUGIN_URL
Description: Origin
Version: 1.0.0
Author: Stephane Demotte
Author URI: NULL
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
if( ! defined( 'ABSPATH' ) ) exit;
if( !class_exists('origin_plugin') ) :
class origin_plugin {
var $settings;
function __construct() {
$this->settings = array(
'version' => '1.0.0',
'url' => plugin_dir_url( __FILE__ ),
'path' => plugin_dir_path( __FILE__ )
);
register_activation_hook(__FILE__, [$this, 'on_plugin_activate']);
add_action('acf/init', [$this, 'acf_init']);
add_action('acf/include_field_types', [$this, 'acf_include_field_types']);
}
function on_plugin_activate() {
global $wp_rewrite;
$wp_rewrite->set_permalink_structure('/wordpress/%postname%/');
$wp_rewrite->flush_rules();
}
function acf_init() {
include_once('options/origin-acf-options.php');
include_once('options/origin-acf-taxonomy.php');
}
function acf_include_field_types( $version = false ) {
include_once('fields/origin-acf-field-unique.php');
include_once('fields/origin-acf-field-slug.php');
include_once('fields/origin-acf-field-tab-name.php');
include_once('fields/origin-acf-field-role-selector.php');
}
}
new origin_plugin();
endif;