使用AI,學習如何編寫WordPress插件經驗分享
Experience Sharing on Learning to Write WordPress Plugins Using AI
Nicholas Yau
https://nicholas.hk
Slide 2
Slide 2 text
Introduction to
WordPress
Plugins
• What is a WordPress plugin?
• Customize and extend functionality of
WordPress sites
Slide 3
Slide 3 text
Empowering Non-Programmers
Non-programmers
can create plugins
to meet specific
needs
01
No coding
experience
required with
simple examples
02
Resources and
tools available for
guidance
03
Slide 4
Slide 4 text
Basic Structure of a WordPress Plugin
File Structure:
Plugin folder
Main plugin file
Key Components:
Plugin header
Settings page for user input
Shortcode for displaying content
Slide 5
Slide 5 text
Demo: Creating a Simple Greeting
Plugin
Objective: Allow users to input a greeting message
Use shortcode to display it on the front end
Slide 6
Slide 6 text
Create Plugin File Structure
Create a folder: greeting-plugin
Create main file: greeting-plugin.php
Visual: Folder structure diagram
Slide 7
Slide 7 text
Explain the requirements in Cursor
Slide 8
Slide 8 text
Create the page greeting-plugin.php by Cursor AI
Slide 9
Slide 9 text
Apply the changes to the file automatically by
clicking “Accept”
Slide 10
Slide 10 text
Upload the plugin and activate it
Slide 11
Slide 11 text
Input text in the Greeting Plugin Settings page
Slide 12
Slide 12 text
Step 6 - Usage
Use the shortcode [greeting] in posts/pages.
Display the greeting message set in the admin settings.
Slide 13
Slide 13 text
Using AI Tools to Simplify Development
AI TOOLS FOR CODE
GENERATION (E.G., CHATGPT,
GITHUB COPILOT)
EXAMPLES OF HOW AI CAN
ASSIST WITH PLUGIN
DEVELOPMENT
REDUCING THE LEARNING
CURVE FOR NON-
PROGRAMMERS
Slide 14
Slide 14 text
Conclusion
Recap of how non-programmers can create plugins
Encouragement to experiment with simple plugins
Resources for further learning
Slide 15
Slide 15 text
Q&A Session • Questions & Answers
• Feel free to ask any questions!