-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
714 additions
and
752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 Henner Setyono | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,126 @@ | ||
# Edje WordPress | ||
# Edje WordPress Library | ||
|
||
![Edje Wordpress](http://cdn.setyono.net/edge/wp-edge.jpg) | ||
![Edje Wordpress](https://cdn.setyono.net/edge/wp-edge.jpg) | ||
|
||
Simplify WordPress complicated functions. | ||
WordPress is a fantastic web platform, but it's complicated for developer. This plugin helps simplifying many functions. | ||
|
||
## Requirement | ||
**REQUIREMENT** | ||
|
||
- PHP 5.6+ | ||
- WordPress 4.9+ | ||
- PHP 7.0+ | ||
- WordPress 5.0+ | ||
|
||
## Sample Features | ||
**TABLE OF CONTENTS** | ||
|
||
Create new Custom Post Type | ||
1. [Custom Post Type](#custom-post-type) | ||
1. [Custom Taxonomy](#custom-taxonomy) | ||
1. [Theme Customizer](#theme-customizer) | ||
1. [Post Table Columns](#post-table-columns) | ||
1. [Other Features](#other-features) | ||
|
||
## 1. Custom Post Type | ||
|
||
[Read full documentation »](https://github.com/hrsetyono/edje-wp-library/wiki/Custom-Post-Type) | ||
|
||
![Edje WordPress - Product Custom Post Type](https://cdn.setyono.net/edjewp/cpt-product.jpg) | ||
|
||
```php | ||
H::register_post_type( 'product' ); | ||
H::register_post_type( 'product', [ | ||
'icon' => 'dashicons-cart', | ||
'supports' => [ 'comments' ] | ||
] ); | ||
``` | ||
|
||
Add new Admin Sidebar menu: | ||
## 2. Custom Taxonomy | ||
|
||
[Read full documentation »](https://github.com/hrsetyono/edje-wp-library/wiki/Custom-Taxonomy) | ||
|
||
![Edje WordPress - Product Custom Post Type](https://cdn.setyono.net/edjewp/cpt-product.jpg) | ||
|
||
```php | ||
H::add_menu( 'Home' array( | ||
'slug' => 'post.php?post=10&action=edit', | ||
'icon' => 'dashicons-admin-home', | ||
'position' => 'above Pages' | ||
)); | ||
H::register_taxonomy( 'brand' , [ | ||
'post_type' => 'product', | ||
] ); | ||
``` | ||
|
||
Sending push notification after publishing new post: | ||
|
||
## 3. Theme Customizer | ||
|
||
[Read full documentation »](https://github.com/hrsetyono/edje-wp-library/wiki/Customizer) | ||
|
||
You can access this from **Appearance > Customizer**. By default, only Administrator role can see this page. | ||
|
||
![Edje Customize Example](https://cdn.setyono.net/edjewp/cust-sample-header.jpg) | ||
|
||
```php | ||
add_action( 'publish_post', 'after_publish_notify_users', 10, 2 ); | ||
|
||
function after_publish_notify_users( $id, $post ) { | ||
$payload = array( | ||
'title' => $post->post_title, | ||
'body' => $post->post_excerpt, | ||
); | ||
H::send_push( $payload ); | ||
add_action( 'customize_register', 'my_customize_register' ); | ||
|
||
function my_customize_register( $wp_customize ) { | ||
$c = H::customizer( $wp_customize ); // init the class | ||
|
||
$c->add_section( 'header' ); | ||
|
||
$c->add_theme_mod( 'head_code', 'code_editor htmlmixed' ); | ||
$c->add_theme_mod( 'background_color', 'color' ); | ||
$c->add_theme_mod( 'phone_no', 'text' ); | ||
} | ||
``` | ||
|
||
## Visit our [WIKI](https://github.com/hrsetyono/edje-wp/wiki) for full documentation. | ||
## 4. Post Table Columns | ||
|
||
[Read full documentation »](https://github.com/hrsetyono/edje-wp-library/wiki/Table-Columns) | ||
|
||
![Edje WordPress - Complex Column](https://cdn.setyono.net/edjewp/cpt-column.jpg) | ||
|
||
```php | ||
H::override_columns( 'product', [ | ||
'title', | ||
'price', | ||
'Discount' => 'show_discounted_price', | ||
] ); | ||
|
||
function show_discounted_price( $post, $fields ) { | ||
$discount = isset( $fields['discount'] ) ? $fields['discount'][0] : null; | ||
$price = isset( $fields['price'] ) ? $fields['price'][0] : null; | ||
|
||
$total = $price - ($price * $discount / 100); | ||
$saving = $price - $total; | ||
|
||
return $discount . '% Discount - You save ' . $saving; | ||
} | ||
``` | ||
|
||
## 5. Other Features | ||
|
||
All these features are enabled by default: | ||
|
||
**JavaScript** | ||
|
||
- Removed emoji converter. | ||
- Removed ability to embed WordPress post. | ||
- Removed Jetpack's Device-px script because it's useless. | ||
- Removed Jetpack's Sharing script. It's only for sharing via email which is rarely used. | ||
- [COMING SOON] Removed jQuery and jQuery migrate. If you need jQuery, enqueue it in your Theme. | ||
|
||
**SEO** | ||
|
||
- Disabled automatic URL guessing if a visitor enters 404 page. | ||
- Disabled Jetpack's Open Graph module when Yoast or The SEO Framework is installed | ||
|
||
**CUSTOMIZER** | ||
|
||
- Added Head and Footer code field. | ||
- Added Theme Color field in Site Identity for changing the actionbar color in Chrome mobile. | ||
|
||
**EDIT POST** | ||
|
||
- Removed Medium-Large size when uploading new image. | ||
- Changed the Category checklist to always be in same the position. | ||
- Added a better styling to WYSIWYG classic editor. | ||
- Added styling to Gutenberg editor for ACF block. | ||
|
||
**OTHER** | ||
|
||
- Removed "Created by Wordpress" message in the bottom-left of WP Admin | ||
- Changed the login error message to "Sorry, your username or password is wrong" instead of giving hint of which one is wrong. | ||
- Changed the Wordpress logo in login page to the one you have set in Customizer > Site Identity. | ||
- Added the ability to edit TWIG file in Appearance > Editor. But it's still recommended to disable Editor by adding this line in WP Config: `define('DISALLOW_FILE_EDIT', true);` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "pixelstudio/edje-wp-library", | ||
"version": "2.0.0", | ||
"description": "Plugin to simplify WordPress complicated functions.", | ||
"keywords": ["wordpress", "plugin", "library"], | ||
"type": "wordpress-plugin", | ||
"homepage": "https://github.com/hrsetyono/edje-wp-library/", | ||
"authors": [ | ||
{ | ||
"name": "Pixel Studio", | ||
"email": "[email protected]", | ||
"homepage": "https://pixelstudio.id" | ||
} | ||
], | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.0.0", | ||
"composer/installers": ">=1.6.0" | ||
} | ||
} |
Oops, something went wrong.