15 votes
Accepted

Wordpress Unit Testing - Cannot Create Tables

You've just discovered an important feature of the core test suite: it forces any tables created during the test to be temporary tables. If you look in the WP_UnitTestCase::setUp() method you'll see ...
J.D.'s user avatar
  • 3,915
13 votes

Removing filter dropdown in posts table (in this case Yoast SEO)

Updated answer for Yoast SEO Version: 7.0.2 This will remove both seo score filter and readability filter from posts list edit page in WordPress admin. add_action( 'admin_init', '...
BenB's user avatar
  • 795
11 votes

Where are wordpress custom types stored?

As mentioned by @milo in this answer Post Types aren't actually stored separately in the database however that being said... via SQL you can view all saved PUBLIC post types using the following sql ...
Craig Wayne's user avatar
4 votes
Accepted

How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

Look at this code public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'address': case 'city': return $item[ $column_name ]; ...
bravokeyl's user avatar
  • 3,349
3 votes
Accepted

stdObject stored in database. How does one convert it to usable format?

You unserialize() it. Be aware that most WordPress functions will automatically unserialize() database content before using it. See, for example, the Used By list for maybe_unserialize(). This is by ...
Pat J's user avatar
  • 11.8k
3 votes

Change options table prefix only

This is actually not that hard, but you will have to excuse me for keeping it high level because this is just a stupid thing to do as all things which are security by obscurity. All you need to do is ...
Mark Kaplun's user avatar
  • 23.4k
3 votes
Accepted

Why my database table not created on activation?

The rule of thumb is to never do anything which is not triggered by action or filter. In this case you try register a hook before wordpress even finished to "boot". This may work sometimes, but ...
Mark Kaplun's user avatar
  • 23.4k
3 votes
Accepted

Display Tables in a slider

Here is one way to do it. You should be able to create a simple jQuery and CSS slider to better display the TablePress tables. Here is a good example of a simple jQuery slider you could use: https://...
junkrig's user avatar
  • 448
3 votes

How to access custom Wordpress database tables

Are you sure that's the table name? Usually on install WordPress prompts you to setup a table prefix so the default isn't wp_. Additionally, you need to call the global $wpdb object so it's ...
Howdy_McGee's user avatar
  • 20.6k
2 votes

Is there alternative to WP_List_Table?

My choice would be to use WP_List_Table. If you continue reading the Codex it makes it clear that it is commonly used by third party code. "Someday" it might go away, but I doubt it will happen ...
BillK's user avatar
  • 540
2 votes
Accepted

How to update an existing table while updating plugin?

register_activation_hook() only attaches a function to run on activation of your plugin, not on updating. See the docs for full details, particularly this part: 3.1 : This hook is now fired only ...
Tim Malone's user avatar
  • 4,734
2 votes

Removing filter dropdown in posts table (in this case Yoast SEO)

and you can add this line to the above function to remove the readability dropdown too: remove_action( 'restrict_manage_posts', array( $wpseo_meta_columns, 'posts_filter_dropdown_readability' ) )...
medicamin's user avatar
2 votes

Customizing WP tables or adding new ones?

Creating a table for your WordPress database requires a considerable amount of time. Wordpress Codex has an article with a step by step guide on how to do this, which basically consists of creating a ...
vasquez_jesus's user avatar
2 votes
Accepted

Customizing WP tables or adding new ones?

You should avoid adding new tables or customising the existing tables to add fields for users. If you want to store a phone number etc, do it using user meta: add_user_meta( $user_id, '...
Tom J Nowell's user avatar
  • 59.2k
2 votes
Accepted

Moving to another host; which tables to move in a database

I never personally tried this, but your images and posts reside in your {prefix}posts (wp_posts) table. I would also copy {prefix}postmeta (wp_postmeta) over. So copying over those table should do ...
bynicolas's user avatar
  • 2,279
2 votes
Accepted

Are custom post types suitable for storing high numbers of data elements, in this case chat messages?

As far as I can see, the main problem you might have to deal with is having to store a fairly large amount of chat messages. So to avoid making WP core functionalities querying post and postmeta from ...
ClemC's user avatar
  • 1,965
2 votes
Accepted

How to show/hide php table rows based on the content of custom fields

You just need to render each section a little more efficiently. Making it look nice with all the fancy spacing won't pay off when a computer is reading the code (see tab v. space). So for the '...
jgraup's user avatar
  • 9,744
2 votes

Get random row from custom table

[Note: @marwyk87 posted his answer while I was composing this, which represents another way to fix the problem] You've got a simple syntax error in your SQL, because of the way you're referencing the ...
Paul 'Sparrow Hawk' Biron's user avatar
2 votes
Accepted

Tablepress won't update the table data

TablePress is simply a plugin that allows you to create tables without coding. You can upload a CSV, sure, but once it's uploaded, if you want the data to reflect the source CSV, you'll have to upload ...
Ian's user avatar
  • 969
2 votes
Accepted

display menu as table layout

Editing my answer. See the screenshot, if it's close enough to what you're looking for, try adding the following to your stylesheet. .header_menu_res ul li { margin: 0 0 20px; width: 25%; } ....
Carl Elder's user avatar
2 votes

Is it a good idea to add a column to the posts table?

Adding another column wouldn't break the code at all .. but it might create issues while updating WordPress to a new version .. It's better to add another table having fields (ID PK Auto Increment, ...
Hassan Alvi's user avatar
2 votes
Accepted

How can I create this type of table/catalog?

You should create custom post type - you can do it with code in functions.php or using a plugin Create basic page template to loop through new post type Add custom fields to store extra data as in ...
Alex P's user avatar
  • 106
2 votes
Accepted

Code is providing a row of data but not formatting it as table

It's not displayed as table, because you don't return correct HTML code. Let's take a look at your code (I've put comments at end of incorrect lines): $content = '<table>'; $content .= '</tr&...
Krzysiek Dróżdż's user avatar
2 votes
Accepted

Add table controls with wp_editor minimal editor configuration ('teeny')

Finally got it running with few pieces of extra buttons too :): <?php $tinymce_options = array('plugins' => "table,lists,link,textcolor,hr", 'toolbar1'=>"fontsizeselect,forecolor,backcolor,...
sariDon's user avatar
  • 265
2 votes
Accepted

Adding a Table to the wordpress database

Try: function vw_postcode_checker_create_db () { global $wpdb; // Create Table Name $table_name = $wpdb->prefix . "vw_postcode_checker"; // Write Query to add table to database ...
shanebp's user avatar
  • 5,063
2 votes
Accepted

Why Query is returning empty array?

you may need to wrap $slug in quotes $course = $wpdb->get_results( "SELECT * FROM wp_posts where post_name = '$slug'" );
ViralP's user avatar
  • 310
2 votes

Saving contact form 7 data into custom Table

CF7 has an useful hook wpcf7_submit that can be used to process the data sent: add_action("wpcf7_submit", "SE_379325_forward_cf7", 10, 2); function SE_379325_forward_cf7($form, $...
Andrea Somovigo's user avatar
2 votes
Accepted

Identifying Plugins Based on Tables

This could be from a number of plugins, including WPForms, RankMath, and Woocommerce — it is the Action Scheduler, something that is included in them, originally made by Woocommerce. What I'd suggest ...
Nabha Cosley's user avatar
2 votes

Identifying Plugins Based on Tables

There is no widely standardized approach to creating plugin tables, and no means to "register" them with WordPress. The most universal solution to discovering which plugin is responsible for ...
bosco's user avatar
  • 6,805
1 vote
Accepted

Order By table field comment_status in WordPress > 4.0

Here's a way to add an extra Comment Status field to the posts list table: add_filter('manage_post_posts_columns', function ( $columns ) { $_columns = []; foreach( (array) $columns as $key =...
birgire's user avatar
  • 67.1k

Only top scored, non community-wiki answers of a minimum length are eligible