The difference is pretty simple.
$wpdb->prefix
is getting the prefix
field from global $wpdb
object.
$table_prefix
can be anything. Most probably it’s some local variable that contains the same value, but you can assign anything to that variable.
So using $wpdb->prefix
is a better idea – it’s nicer, cleaner and more obvious.
Related Posts:
- How can I find plugins’ slug?
- How to implement WordPress plugin update that modifies the database?
- My custom made plugin has “a new version available” which links to unrelated plugin
- wp.media update options and force render on uploader
- How to remove duplicate sub-menu name for top level menu items in a plugin?
- WordPress Plugin Development from Scratch. How? [closed]
- Customize plugin update “new version is available” text
- “Donate to this plugin” for WordPress.org Plugin Authors
- How to handel multiple checkbox field in the admin settings page with Settings API
- How to show custom message once on plugin activation?
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- How to fetch serialized data from wordpress options
- Passing URL parameters to WordPress pages and pretty url
- WordPress network: set themes and plugins for new blog
- How to get the custom page get_permalink?
- Plugin translations problem
- Advanced Custom Fields into functions.php
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- What is the function to get plugin base url in multisite?
- PDF download – use wordpress functions
- Admin-ajax.php is dying “0” without processing function
- How do I register a stylesheet inside a WordPress widget?
- WordPress register_activation_hook table creation not working
- API to filter new user registration $POST data?
- How to remove an Ajax action
- nonces in custom oop plugin
- Set cookie then immediantly refresh the page
- Has anyone used require.js for handling plugin scripts?
- Multiple files in a plugin
- Wp die causing 500 Internal Server Error?
- adding a new value to a serialized array in WP_option table
- Redirect to a welcome page after updating plugin
- Write to / remove from default .htaccess file from plugin?
- Remove rewrite rules generated by plugin during deactivation
- How to Create a Custom Plugin Permalink
- link bbpress forum discussion to blogposts
- How to inform the user that the save was not successful?
- php page not found for plugin options menu
- Re use the list table for a custom post type on another page
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Create a plugin from within WordPress
- Class variables not correct on page
- Render content of multiple pages and their descendants
- Why am I unable to load scripts in head in plugin?
- wp-load.php redeclares classes
- Plugin main file is constantly been fired on every website visit
- Where should custom post types be registered in a plugin?
- How to use the CSS of the WordPress core in the development of my administration page?
- output html on post or page from custom plugin [closed]
- Change the number of plugins counted on wp-admin/plugins.php
- plugin uninstall function drop the tables, but shows errors on admin
- How to use template inside plugin shortcode with variables for big HTML code
- WordPress Object Oriented plugin development [closed]
- Way to send multiple values for column to MySQL?
- What’s the right way to implement functions in footer.php
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- How can i list random author?
- Our plugin tags not appearing in WordPress Plugin Repository
- How can I create a page as a draft from my plugin?
- How to get values from network settings panel?
- Does WordPress do any internal caching if no plugin installed?
- Conditional delete metadata does not works
- Cron: Update four post at Hour
- submit two file input fields in the same form
- Unexpected character and syntax error on wp-includes/formatting.php [closed]
- Error datatable whit ajax
- Potential issue that plugin could have when it will be installed on several sites
- The function called on the wp head hook becomes null
- custom post type get_posts() function not work
- Create multiple posts when a custom post is created
- working code, not working – Plugin Dev
- category page multiple products add to cart any plugin available for woocommerce
- Cannot view Custom Post Type no matter what I try
- Nested Actions and Filters
- How to use information from the database in the front-end?
- Modify Plugin PHP Class in Child Theme – Correct Method
- How to use custom footer template in a site-plugin?
- Problem with conditional woocommerce custom checkout field
- trying to create simple plugin to filter categories from all authors
- How to create a new database table whenever user changes options
- Am I correctly adding styles to plugin?
- Change wp_mail SMTP settings for each E-Mail
- Proper Failure of Plugin Activation
- WordPress Thumbnail add action if no thumbnail
- What is the Object for WP_Error Class?
- How can I add the custom taxonomy categories to the posts and pages?
- Pass strings to plugin function [closed]
- Ajax in Plugins: returns the whole page
- How to create a page template using custom plugin
- WordPress 3,5 and Jquery version
- how to search through plugin in wordpress cimy-user-extra-fields?
- Any way to hook into WP after a page displays?
- contact form 7 captcha support anyother captcha plugin? [closed]
- How to add custom html to the Media > Attachment Details modal?
- manage_{taxonomy}_custom_column not working
- Suitable hook when creating, updating and deleting posts programmatically
- How to be Variables and options must be escaped when echo’d?
- How to override plugin function in code snippets WordPress
- How can I gather forums posted by visitors from different sites in one place? [duplicate]
- How to make content as required in custom post type?