Book description
WordPress is much more than a blogging platform. As this practical guide clearly demonstrates, you can use WordPress to build web apps of any type—not mere content sites, but full-blown apps for specific tasks. If you have PHP experience with a smattering of HTML, CSS, and JavaScript, you’ll learn how to use WordPress plugins and themes to develop fast, scalable, and secure web apps, native mobile apps, web services, and even a network of multiple WordPress sites.
Table of contents
- Preface
- Foreword
-
1. Building Web Apps with WordPress
- What Is a Website?
- What Is an App?
- What Is a Web App?
- Why Use WordPress?
- When Not to Use WordPress
- WordPress as an Application Framework
-
Anatomy of a WordPress App
- What Is SchoolPress?
- SchoolPress Runs on a WordPress Multisite Network
- The SchoolPress Business Model
- Membership Levels and User Roles
- Classes Are BuddyPress Groups
- Assignments Are a Custom Post Type
- Submissions Are a (Sub)CPT for Assignments
- Semesters Are a Taxonomy on the Class CPT
- Departments Are a Taxonomy on the Class CPT
- SchoolPress Has One Main Custom Plugin
- SchoolPress Uses a Few Other Custom Plugins
- SchoolPress Uses the StartBox Theme Framework
-
2. WordPress Basics
- WordPress Directory Structure
-
WordPress Database Structure
- wp_options
- Functions Found in /wp-includes/option.php
- wp_users
- Functions Found in /wp-includes/…
- wp_usermeta
- wp_posts
- Functions found in /wp-includes/post.php
- wp_postmeta
- Functions Found in /wp-includes/post.php
- wp_comments
- Functions Found in /wp-includes/comment.php
- wp_commentsmeta
- Functions Found in /wp-includes/comment.php
- wp_links
- wp_terms
- Functions Found in /wp-includes/taxonomy.php
- wp_term_taxonomy
- /wp-includes/taxonomy.php
- wp_term_relationships
- Extending WordPress
- 3. Leveraging WordPress Plugins
-
4. Themes
- Themes Versus Plugins
- The Template Hierarchy
- Page Templates
- Theme-Related WP Functions
- Style.css
- Functions.php
- Themes and Custom Post Types
- Popular Theme Frameworks
- Creating a Child Theme for StartBox
- Including Bootstrap in Your App’s Theme
- Menus
- Responsive Design
- Versioning CSS and JS Files
-
5. Custom Post Types, Post Metadata, and Taxonomies
- Default Post Types and Custom Post Types
-
Defining and Registering Custom Post Types
-
register_post_type( $post_type, $args );
- label
- labels
- menu_name
- description
- publicly_queryable
- exclude_from_search
- capability_type
- capabilities
- map_meta_cap
- hierarchical
- public
- rewrite
- has_archive
- query_var
- supports
- register_meta_box_cb
- permalink_epmask
- taxonomies
- show_ui
- menu_position
- menu_icon
- can_export
- show_in_nav_menus
- show_in_menu
- show_in_admin_bar
- delete_with_user
- _builtin
- _edit_link
-
register_post_type( $post_type, $args );
- What Is a Taxonomy and How Should I Use It?
- Using Custom Post Types and Taxonomies in Your Themes and Plugins
- Metadata with CPTs
- Custom Wrapper Classes for CPTs
- 6. Users, Roles, and Capabilities
- 7. Other WordPress APIs, Objects, and Helper Functions
-
8. Secure WordPress
- Why It’s Important
- Security Basics
- Hardening Your WordPress Install
- Backup Everything!
- Scan Scan Scan!
- Useful Security Plugins
-
Writing Secure Code
- Check User Capabilities
- Custom SQL Statements
-
Data Validation, Sanitization, and Escaping
- esc_url( $url, $protocols = null, $_context = display )
- esc_url_raw( $url, $protocols = null )
- esc_html( $text )
- esc_js( $text )
- esc_attr( $text )
- esc_textarea( $text )
- sanitize_option( $option, $value )
- sanitize_text_field($str)
- sanitize_user( $username, $strict = false )
- sanitize_title( $title, $fallback_title = '' )
- sanitize_email( $email )
- sanitize_file_name( $filename )
- wp_kses( $string, $allowed_html, $allowed_protocols = array () )
-
Nonces
- wp_create_nonce( $action = -1 )
- wp_verify_nonce($nonce, $action = -1)
- check_admin_referer($action = -1, $query_arg = _wpnonce)
- wp_nonce_url( $actionurl, $action = -1 )
- wp_nonce_field( $action = -1, $name = “_wpnonce”, $referer = true , $echo = true )
- check_ajax_referer( $action = -1, $query_arg = false, $die = true )
- 9. JavaScript, jQuery, and AJAX
-
10. XML-RPC
- wp.getUsersBlogs
- wp.getPosts
- wp.getPost
- wp.newPost
- wp.editPost
- wp.deletePost
- wp.getTerms
- wp.getTerm
- wp.newTerm
- wp.editTerm
- wp.deleteTerm
- wp.getTaxonomies
- wp.getTaxonomy
- wp.getUsers
- wp.getUser
- wp.getProfile
- wp.editProfile
- wp.getCommentCount
- wp.getPageTemplates
- wp.getOptions
- wp.setOptions
- wp.getComment
- wp.getComments
- wp.deleteComment
- wp.editComment
- wp.newComment
- wp.getMediaLibrary
- wp.getMediaItem
- wp.uploadFile
- wp.getPostFormats
- wp.getPostType
- wp.getPostTypes
- 11. Mobile Apps with WordPress
- 12. PHP Libraries, External APIs, and Web Services
-
13. Building WordPress Multisite Networks
- Why Multisite?
- Setting Up a Multisite Network
- Managing a Multisite Network
- Multisite Database Structure
- Multisite Plugins
-
Basic Multisite Functionality
- $blog_id
- is_multisite()
- get_current_blog_id()
- switch_to_blog( $new_blog )
- restore_current_blog()
- get_blog_details( $fields = null, $get_all = true )
- update_blog_details( $blog_id, $details = array() )
- get_blog_status( $id, $pref )
- update_blog_status( $blog_id, $pref, $value )
- get_blog_option( $id, $option, $default = false )
- update_blog_option( $id, $option, $value )
- delete_blog_option( $id, $option )
- get_blog_post( $blog_id, $post_id )
- add_user_to_blog( $blog_id, $user_id, $role )
- create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 )
- Functions We Didn’t Mention
- 14. Localizing WordPress Apps
-
15. Ecommerce
- Choosing a Plugin
- Payment Gateways
- Merchant Accounts
- SSL Certificates and HTTPS
- Setting Up Software as a Service (SaaS) with Paid Memberships Pro
-
The Software as a Service Model
- Step 0: Figure Out How You Want to Charge for Your App
- Step 1: Installing and Activating Paid Memberships Pro
- Step 2: Setting Up the Level
- Step 3: Setting Up Pages
- Step 4: Payment Settings
- Step 5: Email Settings
- Step 6: Advanced Settings
- Step 7: Locking Down Pages
- Step 8: Customizing Paid Memberships Pro
- 16. WordPress Optimization and Scaling
- Index
- Colophon
- Copyright
Product information
- Title: Building Web Apps with WordPress
- Author(s):
- Release date: April 2014
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449364076
You might also like
book
WordPress Development Quick Start Guide
Learn core WordPress concepts and components to create modern WordPress-based solutions Key Features Learn the foundations …
book
WordPress for Web Developers: An Introduction for Web Professionals
WordPress for Web Developers is a complete guide for web designers and developers who want to …
book
WordPress Plugin Development Cookbook - Second Edition
Learn to create plugins for WordPress 4.x to deliver custom projects or share with the community …
book
WordPress 5 Cookbook
Explore built-in WordPress features and the power of advanced plugins and themes for building modern websites …