First off, the usual caveat — Don’t modify core code. (Certainly not on a production site.)
If you read the documentation on the Codex, you’ll notice that most if not all of the pages in, say, the Function Reference have a section called Source File. Clicking the link located there will take you to the file in trac where the particular function lives.
For instance, the Codex page for the_ID() points you to wp-includes/post-template.php.
Your specific questions:
- The
$wpdb()class is inwp-includes/wp-db.php. get_header()is inwp-includes/general-template.php.
Sometimes, though, you’ll have to hunt all over the WordPress codebase to follow the track of how does this work? You’ll find that functions call other functions, which call other functions, which apply filters, and so forth. There’s a lot of digging, sometimes, to understand how something in WordPress actually works. Do it. It’s worth it.
Related Posts:
- Deprecated: mysql_connect()
- dbDelta support for FOREIGN KEY
- is it possible to run some php code within a wordpress page?
- How to correctly submit a search form and display the result in an independent page
- How to use update and delete query in wordpress
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- Does WordPress cache get_user_meta() results?
- Best way to extends core classes in theme?
- Creating a WordPress form with a PHP script and default header
- Using Echo in ShortCode – Stuck
- MySQL query performed 4 times inside loop
- Show only one post for each author ( Page loads too slow )
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- StudioPress: add meta tag to every page [closed]
- Modern Tribe Calendar wp-query with meta query not working at all
- WP database error for comments_popup_link()
- No wp-config.php file on local install of wordpress – site still displays
- Use ajax to update_post_meta
- Using PHP to toggle stylesheet and header image, set in cookie
- Mysterious HTTP 404 header in my own scripts
- Insert all post IDs in new database table
- Is the outdated PHP mysql extension a requirement for WordPress 4.6?
- What SQL / WordPress queries would need a nonce?
- Different database query in function.php using mysqli
- Why is variable not working on custom sql query using wpdb?
- Get WooCommerce product details and transfer them to a custom DB table
- How can I export posts with featured images, without download them
- add_image_size for header_image
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- What is a valid parent for get_terms()?
- WSoD being caused by this piece of code
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Update results, Before deleting the related category [closed]
- Sum the total amount of a specific product purchased per user and display in table
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- Weird 404 URL Problem – domain name being placed at end of urls
- database sent to a JSON file
- $wpdb->insert() does not Insert record in a table
- Headers already sent in Pluggable.php / homepage and wp-login error
- Is_front_page inside header.php is always returning true
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- WordPress wp_redirect error
- WordPress Block developer from exporting Database via PHP
- Clickable image link sends people to wrong URL
- How do I display offsite database info on my wordpress site?
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- Use $wpdb or other PHP script method to find/replace in WP database
- Issue with fetching mysql data and displaying results via shortcode in webpage
- Hide posts if user is added to it WP_query
- Custom route and query
- How to unserialize data from MySQL
- Edit Account – read and write to MySQL
- Get the id of the row from database on click of a button [closed]
- Why when I create a new post I found 2 record related to this post into the posts database table?
- mySQL queries are executed twice on wordpress website
- Most viewed posts in WordPress
- SQL error with custom query
- Modify WooCommerce used to get all orders in dashboard
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Get mysql data for Quick Edit panel
- WordPress can’t use ZipArchive
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- WordPress Bad Request Error 400
- I am facing this error Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- What is the correct way to search 3 custom fields only in WordPress?
- cant insert data in a custom table in phpmyadmin
- Change upload URL by mime type
- autocomplete in wordpress using ajax with json-data
- Premature end of script headers: wp-mail.php?
- setcookie() issues on running with HTTPS on WordPress
- Allow user to choose header style
- Unexpected behavior when trying to manually install WordPress on macOS Sierra
- WordPress post insertion from PHP file
- New database entry to trigger runing PHP/SQL query through link with token, without logging into the website
- How to include different html tags in the header for different pages?
- Query doesn’t display text data with apostrophes
- I want show only data for today
- Rewrite SQL query as a prepared statement and use in foreach loop
- Include a custom field in mysql query
- my site show this symbol (::) between site title and tagline
- Insert double entry in DB
- Splitting One Big WordPress Site into Multiple Small Sites
- Changing 2011 theme header image based on user dropdown
- Warning: Cannot modify header information (with a twist)
- Cannot get custom javascript to execute on page
- How to pass username into form that sends data to database
- How to edit the default database of WordPress [closed]
- Cannot modify header information – headers already sent
- Your PHP installation appears to be missing the MySQL … After deleting and restarting from cpanel
- Dynamic Email Handler with ‘header (“Location: …’
- How to set variable to specific field when querying
- How can precision be improved for the debug log timestamp?
- Getting invalid user ID error when creating a new user with wp_insert_user
- Custom form that stores data in mysql database