Learning the WordPress Core

by Tom Carney

October 28th, 2017

About Me

  • Born and Raised in Philadelphia
  • Working with WordPress for 9 years
  • Favorite things to do in WordPress to create themes and plugins.
  • Also love writing, reading, blogging, and sports.

Overview

  • Defining the WordPress Core & Structure
  • Golden Rule #1
  • Advantages of understanding Core files
  • Take a look at a files
  • Resources and Links
  • Q and A

What is WordPress Core?

Comprised of:

Root Files

    These are configuration type files -

WP-Admin folder

     Mostly runs the admin dashboard of the WordPress site.  

WP-Includes folder

     Provides libraries, APIs and functionality for WordPress' front end

WP-Content folder

     Code for the Front End and editable

Golden Rule:

Do Not Edit WP Core Files!

 

When you update the Core - those changes are lost forever

 

Also can cause errors and functionality issues when changed.

Root Files:

wp-config.php

    Sets up database connection to server, debugging logs, and other configuration.

.htaccess

    Controls the permalink structure and redirection for the site   

wp-cron.php

    Provides the server scheduling for the site (e.g. scheduling posts)

 

WP Admin

  • Each file/folder runs a feature in the dashboard or the administration of the WordPress site.

Look at the files

Admin.php

Network.php

Has functionality that connects to the database.

Checks whether users have administrative permissions.

Provides Multisite functionality -

   Mostly Configuration and Installation

Users.php

Controls the User Admin panel in the sites dashboard.

WP Includes

WP Includes

Contains everything needed to run WordPress via the frontend

  • Libraries, APIs and functionality that the front end refers back to.
  • Provides the structure (template.php, theme.php and others) for the theme and plugin files can default to and use.






functions.php

Registers the rest api endpoints for posts, pages, etc.

Registers rewrite rules for the API

 

rest-api.php

Operates like a plugin - calls on predefined functions, and extending them.

Can extend this file by adding to it in the theme's own functions.php file.

Controls for retrieving default templates parts and functions

Gives a good guide on the template hierarchy

 

 

template.php

Advantages

  • Debugging Errors
  • Easier recognition of what Wordpress can do when designing your next site
  • Makes it easier to code within WP 

Links:

Questions

WordPress Core

By Tom Carney

WordPress Core

  • 1,466