Overview of the universal WordPress front-end development framework
Authorization Statement
contact information
Core principles:
Function list
See/docs for more details
matters needing attention
User Role
-
Role of ordinary registered user: author -
Editor and above roles are defined as administrator wnd_is_manager() -
After the plug-in is enabled, the WordPress native registration and login functions will be disabled. Ordinary users cannot use the WordPress background, and some unnecessary user meta of ordinary registered users will be deleted -
After enabling the plug-in, the native rest api of WordPress will be disabled -
After the plug-in is enabled, it will periodically clean: XXX_tag tags
Classification and label association
$post_type.'_ Cat ';//Taxonomy $post_type.'_ Tag ';//Tag taxonomy
Category name
add_filter / add_action
-
Priority: 10 is the default value of WordPress. The higher the value, the later the execution -
For filter: it can be understood that the larger the value, the higher the weight of the current add_filter -
For action: the earlier the execution is, the higher the weight is
Custom Article Type
-
Recharging: recharge -
Consumption and order: order -
In station mail: mail -
Monthly financial statistics of the whole station: stats re (recharge), stats ex (consumption)
Custom Post Status
success
close
Custom article version
$revision['post_parent'] = $post->ID $revision['post_type'] = $post->post_type //In addition, to distinguish regular child posts, set the wp post meta in the custom revision: update_post_meta($revision_id, '_wnd_revision', 'true');
Version creation conditions:
Custom version function:
-
When users edit published articles, they will create a version and submit it to the administrator for approval. -
If the administrator passes the review, the published article will be smoothly replaced with the version content, and the version will be deleted at the same time. -
Only one version of an article can be created. Revise again during version review. The original text, or version, will directly modify the existing created version, rather than create a new one.
Article Custom Field
WordPress native fields
Wnd custom field
-
Wnd_meta: file (id for storing paid attachments) -
Downld_meta: download_count (download statistics) -
Wnd_data: order_count (order statistics, including orders not completed within 15 minutes) -
Wnd_meta: total_sales: total sales of paid content -
Wnd_mata: total_commission: the total commission obtained by the author -
Wnd_meta: attachment_records (cumulative total number of attachments uploaded to the current article, including deleted attachments, used to automatically set menu_order for attachments) -
Wnd_mata: gallery (article album, which stores attachment id in array form)
User defined fields
-
Wnd_mata: money: balance -
Wnd_meta: expense: consumption -
Wnd_mata: commission: commission -
Wnd_meta: avatar: avatar file -
Id wnd_meta: avatar_url: avatar outer chain -
Wnd_meta: locale: user language
Recharging and consumption (custom article type)
-
Amount: post_content -
Association: post_parent -
Title: post_title -
Status: post_status: pending/success -
Type: post_type: record/order -
Online payment platform: post_exceprpt (e.g. alipay, wepay)
refund
//Data format of refund operation record [ [ 'user_id' => get_current_user_id(), 'refund_amount' => $refund_amount, 'time' => time(), ] ];
data base
wp_users:
wp_posts:
In station communication function
wp_options
-
Plug in configuration: wnd -
Custom top articles: wnd_sticky_posts -
Data format of top articles: two-dimensional array wnd_sticky_posts [$post_type] ['post '. $post_id]
Multilingual settings
/** *@since 2020.01.14 *Add "New" in any current link? Lang=xx parameter to switch to the corresponding language *Note: the corresponding language pack support is required; Only Chinese and English are supported temporarily */ $_GET['lang']
Statistics of views
<javaScript> wnd_ajax_update_views(post_id, interval = 3600); </javaScript>
Download permission
-
¥ Free download Download after reviewing and refreshing Download after login
View Demo
-
{{attr.name}}: