售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
WordPress Web Application Development
Table of Contents
WordPress Web Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. WordPress As a Web Application Framework
WordPress as a CMS
WordPress as a web development framework
MVC versus event-driven architecture
Simplifying development with built-in modules
Identifying the components of WordPress
The role of the WordPress theme
The structure of a WordPress page layout
Customizing the application layout
The role of the admin dashboard
Admin dashboard
Posts and pages
Users
Appearance
Settings
The role of plugins
The role of widgets
A development plan for a portfolio management application
Application goals and a target audience
Planning the application
User roles of the application
Planning application features and functions
Understanding limitations and sticking with guidelines
Building a question-answer interface
Prerequisites
Creating questions
Changing the status of answers
Saving the status of answers
Generating the question list
Summary
2. Implementing Membership Roles, Permissions, and Features
Introduction to user management
Preparing the plugin
Getting started on user roles
Creating user roles for a application
What is the best action for adding user roles?
Knowing the default roles
How to choose between default and custom roles?
Scenario 1
Scenario 2
Removing existing user roles
Understanding user capabilities
Creating your first capability
Understanding default capabilities
Registering application users
Implementing the frontend registration
Shortcode implementation
Pros and cons of using shortcodes
Page template implementation
Pros and cons of page templates
Custom template implementation
Building a simple router for user modules
Creating the routing rules
Adding query variables
Flushing the rewriting rules
Controlling access to your functions
What are the advantages of using do_action?
Creating custom templates
Designing the registration form
Planning the registration process
Handling registration form submission
Activating system users
Creating a login on the frontend
Displaying a login form
Time to practice
Summary
3. Planning and Customizing the Core Database
Understanding the WordPress database
Exploring the role of existing tables
User-related tables
Post-related tables
Term-related tables
Other tables
Adapting existing tables into web applications
User-related tables
Post-related tables
Scenario 1 – an online shopping cart
Scenario 2 – hotel reservation system
Scenario 3 – project management application
Term-related tables
Other tables
Extending a database with custom tables
Planning the portfolio application tables
Types of tables in web applications
Creating custom tables
Querying the database
Querying the existing tables
Inserting records
Updating records
Deleting records
Selecting records
Querying the custom tables
Working with posts
Extending WP_Query for applications
Limitations and considerations
Transaction support
Post revisions
How to know whether to enable or disable revisions
Autosaving
Using metatables
Summary
4. The Building Blocks of Web Applications
Introduction to custom content types
The role of custom post types in web applications
Planning custom post types for the application
Projects
Services
Articles
Books
Implementing custom post types for a portfolio application
Implementing the custom post type settings
Creating a projects class
Assigning permissions to projects
Creating custom taxonomies for technologies and types
Assigning permissions to project type
Introduction to custom fields with meta boxes
What is a template engine?
Configuring Twig templates
Creating your first Twig template
Persisting custom field data
Customizing custom post type messages
Passing data to Twig templates
Introduction to custom post type relationships
Pods framework for custom content types
Should you choose Pods for web development?
Time to practice
Summary
5. Developing Pluggable Modules
A brief introduction to WordPress plugins
Understanding the WordPress plugin architecture
WordPress plugins for web development
Create reusable libraries with plugins
How to use AJAX in WordPress
Creating an AJAX request using jQuery
Defining AJAX requests
Drawbacks in a normal process
Planning the AJAX plugin
Creating the plugin
Including plugin scripts for AJAX
Creating reusable AJAX requests
Extensible plugins
Planning the file uploader for portfolio application
Creating the extensible file uploader plugin
Converting file fields with jQuery
Integrating the media uploader to buttons
Extending the file uploader plugin
Customizing the allowed types of images
Saving and loading project screens
Pluggable plugins
Time to practice
Summary
6. Customizing the Dashboard for Powerful Backends
Understanding the admin dashboard
Customizing the admin toolbar
Removing the admin toolbar
Managing the admin toolbar items
Customizing the main navigation menu
Creating new menu items
Adding features with custom pages
Building options pages
Automating option pages with SMOF
Customizing the options page to use as a generic settings page
Building the application options panel
Using the WordPress Options API
Using feature-packed admin list tables
Building extended lists
Using an admin list table for following developers
Step 1 – defining the custom class
Step 2 – defining instance variables
Step 3 – creating the initial configurations
Step 4 – implementing custom column handlers
Step 5 – implementing column default handlers
Step 6 – displaying the checkbox for records
Step 7 – listing the available custom columns
Step 8 – defining the sortable columns of the list
Step 9 – creating a list of bulk actions
Step 10 – retrieving list data
Step 11 – adding the custom list as a menu page
Step 12 – displaying the generated list
An awesome visual presentation for the admin dashboard
The responsive nature of the admin dashboard
Time for action
Summary
7. Adjusting Themes for Amazing Frontends
Introduction to a WordPress application's frontend
Basic file structure of a WordPress theme
Understanding template execution hierarchy
Template execution process of web application frameworks
Web application layout creation techniques
Shortcodes and page templates
Custom templates with custom routing
Using pure PHP templates
The WordPress way of using templates
Direct template inclusion
Theme versus plugin templates
Are you planning to create an application-specific theme?
Template engines
Building a portfolio application's home page
What is a widget?
Widgetizing application layouts
Creating widgets
Creating a custom template loader
Designing the home page template
Generating an application's frontend menu
Creating a navigation menu
Displaying user-specific menus on the frontend
Creating pluggable and extendable templates
Pluggable or extendable templates
Extendable templates in web applications
Pluggable templates in WordPress
Comparing WordPress templates with Twig templates
Extending the home page template with action hooks
Customize widgets to enable extendable locations
Planning action hooks for layouts
Time for action
Summary
8. Enhancing the Power of Open Source Libraries and Plugins
Why choose open source libraries?
Open source libraries inside the WordPress core
Open source JavaScript libraries in the WordPress core
What is Backbone.js?
Understanding the importance of code structuring
Integrating Backbone.js and Underscore.js
Creating a developer profile page with Backbone.js
Structuring with Backbone.js and Underscore.js
Displaying the projects list on page load
Creating new projects from the frontend
Integrating events to the Backbone.js views
Validating and creating new models on the server
Creating new models on the server
Using PHPMailer for custom e-mail sending
Usage of PHPMailer within the WordPress core
Creating a custom version of the pluggable wp_mail function
Loading PHPMailer inside plugins and creating custom functions
Implementing user authentication with Opauth
Configuring login strategies
Building a LinkedIn app
Process of requesting the strategies
Initializing the Opauth library
Authenticating users in our application
Using third-party libraries and plugins
Time for action
Summary
9. Listening to Third-party Applications
Introduction to APIs
Advantages of having an API
WordPress XML-RPC API for web applications
Building the API client
Creating a custom API
Integrating API user authentication
Integrating API access tokens
Providing the API documentation
Time for action
Summary
10. Integrating and Finalizing the Portfolio Management Application
Integrating and structuring a portfolio application
Step 1 – deactivating all the plugins used in this book
Step 2 – creating a new standalone plugin
Step 3 – moving all the plugins into wpwa-web-application
Step 4 – removing plugin definitions
Step 5 – creating common folders
Step 6 – loading components to the main plugin
Step 7 – creating the template loader
Step 8 – reusing the autoloader
Step 9 – defining main plugin functions
Step 10 – building the template router
Step 11 – building the activation controller
Step 12 – building the script controller
Step 13 – building the admin menu controller
Step 14 – creating class initializations
Step 15 – initializing application controllers
Restructuring the custom post manager
Integrating a template loader into the user manager
Working with a restructured application
Building the developer model
Designing the developer list template
Enabling AJAX-based filtering
Updating a user profile with additional fields
Updating values of profile fields
Scheduling subscriber notifications
Notifying subscribers through an e-mail
Lesser-known WordPress features
Caching
Transients
Testing
Security
Time for action
Final thoughts
Summary
A. Configurations, Tools, and Resources
Configure and set up WordPress
Step 1 – downloading WordPress
Step 2 – creating the application folder
Step 3 – configuring the application URL
Creating a virtual host
Using a localhost
Step 4 – installing WordPress
Step 5 – setting up permalinks
Step 6 – downloading the Responsive theme
Step 7 – activating the Responsive theme
Step 8 – activating the plugin
Step 9 – using the application
Open source libraries and plugins
Online resources and tutorials
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜