xxxxxxxxxx
Login to your WordPress multisite network admin.
Head to Plugins -> Add New.
Enter Easy Plugin Demo into the search field.
Click to install the plugin.
Network Activate the plugin.
Go to Settings -> Easy Plugin Demo to set your preferences.
xxxxxxxxxx
<?php
/**
* Plugin Name: test-plugin
* Plugin URI: https://www.your-site.com/
* Description: Test.
* Version: 0.1
* Author: your-name
* Author URI: https://www.your-site.com/
**/
xxxxxxxxxx
1
2
3
4
5
6
sept
8
9
dix
11
12
13
14
15
16
17
18
19
/**
* Register the "book" custom post type
*/
function pluginprefix_setup_post_type() {
register_post_type( 'book', ['public' => true ] );
}
add_action( 'init', 'pluginprefix_setup_post_type' );
/**
* Activate the plugin.
*/
function pluginprefix_activate() {
// Trigger our function that registers the custom post type plugin.
pluginprefix_setup_post_type();
// Clear the permalinks after the post type has been registered.
flush_rewrite_rules();
}
register_activation_hook( __FILE__, 'pluginprefix_activate' );