Giter Site home page Giter Site logo

mootoons / wp-react-plugin-standard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 198 KB

Wordpress plugin react standard

License: GNU General Public License v2.0

PHP 81.42% JavaScript 17.78% SCSS 0.79%
i18n react react-router wordpress-development wordpress-plugin wp-scripts

wp-react-plugin-standard's Introduction

Wordpress React Plugin Standard

ปลั๊กอินเริ่มต้นสำหรับ React ซึ่งมี Packages WP-script, React, ReactRouter, Eslint, Prettier, i18n

สำหรับ React Typescript WP React Typescript Plugin Standard


Quick Start BY NPM

# Clone the Git repository
git clone https://github.com/mootoons/wp-react-plugin-standard.git

# Install node module packages
npm install

# Start development mode
npm start

# To run in production
npm run build

Quick Start BY Yarn

# Clone the Git repository
git clone https://github.com/mootoons/wp-react-plugin-standard.git

# Install by yarn module packages
yarn

# Start development mode
yarn start

# To run in production
yarn build

รายละเอียดการปรับแต่งสำหรับงานของคุณเอง

Folder resources

  • สามารถแก้ไข alias import ได้ที่ไฟล์ jsconfig.json และ webpack.config.js

Folder app / search and replace

  • my-app คือ text-domain และ filter key
  • MyApp คือ namespace หรือ class name
  • MY_APP_ คือ constants ต่างๆ ที่ใช้ในปลั๊กอิน

หากแก้ไขในส่วนของ folder app เรียบร้อยแล้วให้รันคำสั่ง

composer install && composer dumpautoload -o

ในส่วนของ php จะใช้ Method onHooks ในการเรียกใช้งานอัตโนมัติ

ตัวอย่างโค้ด

class Example
{
    public function onHooks(): void
    {
        add_action('init', [$this, 'tester']);
    }
    
    public function tester(): void {
        var_dump('Hello Tester');
    }
}

ตัวอย่าง

MyApp-‹-Wordpress-Tester-—-WordPress

wp-react-plugin-standard's People

Contributors

aphagon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.