PHP code example of wp-content-framework / core
1. Go to this page and download the library: Download wp-content-framework/core library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wp-content-framework / core example snippets
/**
* Plugin Name: example
* Plugin URI:
* Description: Plugin Description
* Author: example
* Version: 0.0.0
* Author URI: http://example.com/
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( defined( 'EXAMPLE_PLUGIN' ) ) {
return;
}
define( 'EXAMPLE_PLUGIN', 'Example_Plugin' );
@
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( defined( 'EXAMPLE_THEME' ) ) {
return;
}
define( 'EXAMPLE_THEME', 'Example_Theme' );
@
example
|
- style.css
|
- functions.php
|
- assets
|
- configs
|
- languages
|
- src
| |
| - classes
| | |
| | - controllers
| | | |
| | | - admin
| | | |
| | | - api
| | |
| | - models
| | |
| | - tests
| |
| - views
| |
| - admin
| |
| - help
|
- header.php
- footer.php
- index.php
- searchform.php
- sidebar.php
...
// priority => 詳細
'10' => array(
// 設定グループ => 詳細
'Performance' => array(
// priority => 詳細
'10' => array(
// 設定名 => 詳細
'minify_js' => array(
// 説明
'label' => 'Whether to minify js which generated by this plugin',
// タイプ (bool or int or float or string)
'type' => 'bool', // [default = string]
// デフォルト値
'default' => true,
),
'minify_css' => array(
'label' => 'Whether to minify css which generated by this plugin',
'type' => 'bool',
'default' => true,
),
),
),
),
$this->apply_filters( 'minify_js' ) // true or false
if ( $this->apply_filters( 'minify_js' ) ) {
// ...
}