WndWP - Universal WordPress front-end development framework

Universal WordPress front-end development framework

Overview of the universal WordPress front-end development framework

Authorization Statement

To use this plug-in, please follow the following rules: Attribution - non-commercial use - sharing in the same way 2.5. Authorization fees shall be paid for using this plug-in in the following cases:

① The main users are commercial companies and profit organizations.

② A product that is redeveloped by an individual user based on this plug-in and sold in the form of payment.

If the circumstances are serious, the right to investigate legal responsibility shall be reserved.

Plug in matching theme:

WndWP - 万能的WordPress前端开发框架-Npcink
WndWP - 万能的WordPress前端开发框架-Npcink

Wndt - WordPress blog theme based on Wnd Frontend

contact information

QQ: 245484493 Website: https://wndwp.com

Core principles:

1. Automatically classify and submit data to WordPress articles, article fields, user fields, etc. through the name prefix of the front-end form, so as to achieve extensible front-end form submission

2. Generate wp nonce according to the name value of the form field while generating the form to prevent the form field from being tampered with by the front end

3. The front end uploads the image and stores it in the user field or article field according to the meta_key (generate wp nonce corresponding to the meta_key to achieve meta_key verification)

4. The final underlying implementation of the addition, deletion and modification of users and articles adopts WordPress native functions, so the WordPress native actions and filters in the corresponding operations are effective

5. In relevant ajax operations, set array filter to achieve permission control Unless otherwise specified, fields refer to WndWP custom array fields, not wp native fields

Function list

0. Based on the bulma framework, ajax form submission, ajax pop-up module, and ajax embedding

1. WordPress front-end article addition, deletion and modification (including permission control filter)

2. WordPress front-end registered user addition, deletion and modification (including permission control filter)

3. WordPress order system, preset articles for paid reading and paid downloading (including permission control filter)

4. Payment, SMS module

5. Upload front-end files and pictures

6. Combine and store multiple user_meta, post_meta and options in array form

7. Bulma based form generation class: Wnd_Form Wnd_Form_WP、Wnd_Form_Post、Wnd_Form_User。 Can quickly generate various forms

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

WordPress native post classification and tag association are supported by default. If you need to support custom taxonomy, please follow the following rules:

 $post_type.'_ Cat ';//Taxonomy $post_type.'_ Tag ';//Tag taxonomy

Category name

In this plug-in, if there are multiple classifications with the same name in the same taxonomy, only the last classification will be presented through the Wnd_Form_Post built in this plug-in to construct the article form classification option. To avoid this, ensure that each category name is unique in the same taxonomy.

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

The following post_types are not all private attributes ('public '=>false), so they cannot be viewed in the WordPress background

  • 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

Used for functional posts, (e.g. recharge, order, etc.) wp_insert_post can directly write to unregistered post_status, but unregistered post_status cannot be filtered through wp_query, so register

close

It is used to turn off article related functions, but not delete articles, and keep the front end browsable

Custom article version

This plug-in defines an article version function. Assuming the current $post, the $post version definition is:

 $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:

Non administrator, edit published articles

Custom version function:

Ordinary users publish articles that need to be approved before they can be publicly displayed. If the approved articles need to be modified again, if they are set to pending status, the original post link will be temporarily invalid. In order to avoid this situation in some sites where users are active in submitting articles, the above customized version function is specially introduced:

  • 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

Wp_post_meta: views wp_post_meta: price

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

Wnd_meta: gallery (user album)

Wp_meta: status: user status ['ok ','banned']

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

Wnd_data: refund_count (batch) refund times

Wnd_data: refund_records Refund Operation Record

 //Data format of refund operation record [ [ 'user_id'       => get_current_user_id(), 'refund_amount' => $refund_amount, 'time'          => time(), ] ];

data base

wp_users:

If you need a unique user nickname: it is recommended to add an index to display_name

wp_posts:

To ensure that the title is unique: it is recommended to add prefix index to post_title

In station communication function

Post_type=>mail post_status=>unread: pending read: private

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

see
  • Free download
    Download after reviewing and refreshing
    Download after login

View Demo

  • {{attr.name}}:
Your current level is
Free download after login Sign in The little black room is reflecting. No downloading! Refresh the page after comments Download comment payment Download Later Please first Sign in Your downloads today( It's used up. Please come back tomorrow Pay points Download Later Pay immediately payment Download Later Pay immediately Your current user group is not allowed to download Upgrade Member
You have obtained download permission You can download resources every day Times, remaining today second
plug-in unit

You must follow the WeChat public account to view the free Wordpress plug-in of the specified content

2019-3-31 7:25:17

plug-in unit

Read More Login - Read more at

2019-4-3 9:31:06

⚠️
Some codes and tutorials on Npcink come from the Internet, and are only for netizens to learn and exchange. If you like this article, you can Attach original link Reprint at will.
No intention of infringing your rights, please send an email to 1355471563#qq.com Or click on the right Private message: Muze feedback, we will deal with it as soon as possible.
0 replies A Author M administrators
    There is no discussion yet. Tell me your opinion
Personal Center
Shopping Cart
Coupon
Sign in today
There are new private messages Private Message List
search