Questions tagged [table]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
25 votes
5 answers
37k views

Where are wordpress custom types stored?

Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the <new_custom_post_type>. But where are the details of the new custom post type ...
Noor's user avatar
  • 427
20 votes
2 answers
34k views

Is it mandatory to use $wpdb->prefix in custom tables

Sorry if this question is trivial. I'm just beginning to develop plugins in WordPress. In all the tutorials I found this: while creating the custom tables, $wpdb->prefix is used. Example: $...
newbie's user avatar
  • 215
15 votes
1 answer
8k views

Performance with autoload and the options table

I am playing around with the autoload column of the options table. I didn't find much information about how the autoloaded values are used. I tried a print_r($GLOBALS) and saw that the autoloaded ...
RRikesh's user avatar
  • 5,585
12 votes
1 answer
4k views

What is the use of to_ping and pinged column?

Can anyone explain or show a reference for the use of to_ping and pinged column in the wp_posts table? It seems that my Googling skills have failed me. I wanted to do an experiment using the pinged ...
ifdion's user avatar
  • 1,457
10 votes
3 answers
11k views

Whats the best way to share user data across multiple Wordpress websites?

First of all, Multisite isn't what I'm looking for. I have 5 websites using Wordpress all on separate domains that I would like to enable user accounts for. I need user data to be shared across the ...
Ian's user avatar
  • 959
8 votes
3 answers
5k views

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

I don’t need Yoast SEO meta box for one post type so I removed it with remove_meta_box(). Removed unneeded columns in post table by unsetting columns with manage_edit-custom_post_columns, but drop ...
Rooo's user avatar
  • 93
8 votes
2 answers
2k views

Wordpress Unit Testing - Cannot Create Tables

I'm using PHPUnit to Unit Test my WP plugin on top of the WP testing suite. Everything works fine except that when I try to create a table via the setUp method, the table doesn't get created. Here's ...
Paolo's user avatar
  • 103
7 votes
2 answers
10k views

What for is the table "wp_commentmeta" exactly?

I have been reading about the Database Description of Wordpress. I haven't understood the meaning to the use of the table wp_commentmeta. The documentation says: Each comment features information ...
Enrique Moreno Tent's user avatar
7 votes
5 answers
3k views

Use a separate custom table (not posts) to handle file upload data

The Problem: Website that has over 100 photos per post. Could possibly swell posts-table beyond 100K entries within a few years. The Dilemma: Would much rather stick to default WP UI for handling ...
user28216's user avatar
6 votes
1 answer
93k views

Insert data in database using form

I am writing a simple plugin that create a table with name "newsletter" in database and provide a shortcode to put a registration form in pages. the form contain "name" and "email". i have problem ...
pixelweb's user avatar
6 votes
0 answers
2k views

How can I extend the Gutenberg table block transform to allow colspans/rowspans on pasted table <td> elements?

I'm trying to allow users to paste (relatively) simple tables into Gutenberg. The editor converts the raw HTML fine but strips out any attributes/classes. For the most part this is good - I want to ...
Tommy Ferry's user avatar
5 votes
1 answer
433 views

When is it appropriate to create a new table in the WordPress database?

For a client we'll need 29,000 terms (all the highschool's in the US) and each term needs 6 meta items (address, phone...). My initial thought was to store the term meta information as suggested in ...
curtismchale's user avatar
  • 2,599
5 votes
1 answer
1k views

Has parent field in the table wp_term_taxonomy has term_id or term_taxonomy_id

I have created a category "Book" with a sub category "comics", to check how wordpress is maintaining the hierarchy structure. When i check the table "wp_term_taxonomy", I found that such term with a ...
made_in_india's user avatar
4 votes
1 answer
43k views

How To Make Connection To WordPress Data Base In A Plugin?

I am learning Plugins and I am trying to connect WordPress database wp-config.php in my Plugin PHP code. Currently for checking my code, I used the below connection and it is working fine. Now I ...
Muhammad Hassan's user avatar
4 votes
1 answer
3k views

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

I am trying to implement WP_List_Table for my plugin. I have gone through this tutorial and using its sample plugin. I have installed this plugin and just changed table name and done slightly ...
Faiyaz Alam's user avatar
4 votes
1 answer
8k views

How do you display posts in a dynamic table?

I'm currently using a plug-in called SortTable Post. It automatically takes your posts and puts them into a table that you like. It's a great idea, but the issue is that the plug-in hasn't been ...
Jennifer Moore's user avatar
4 votes
1 answer
7k views

Create a formatted table-like menu

I've just put the site up a couple weeks ago and adding some more things to it for my friend however there's got to be an easier way to lay content out over wordpress. I've having a hard time with it ...
kia4567's user avatar
  • 225
3 votes
2 answers
8k views

Save custom post type in different table

I need to store custom post type post data into a custom table, not in wp_posts and wp_postmeta. Is it possible? anyone help please. Actually, I have created two custom post type named "truck" and "...
Arshad Hussain's user avatar
3 votes
1 answer
2k views

Display Tables in a slider

I'm developing a site where I would like the user to be able to flip through tables, sort of like a gallery. I would like to see one table at a time, and be able to click on an arrow and see the next ...
ellen's user avatar
  • 335
3 votes
2 answers
99 views

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

I'm developing a system that will have around 2k users and they will be communicating with an internal live chatting system. Now I'm wondering if it's a good choice to store messages as custom post ...
Nazia's user avatar
  • 33
3 votes
2 answers
12k views

Creating search form for custom database table

I have a custom table in the WP database which I can display fine, with pagination, using the following code: <?php global $wpdb; $rows_per_page = 50; $current = (intval(get_query_var('paged'))) ?...
user37060's user avatar
3 votes
1 answer
315 views

Is there a wordpress function to cleanly delete an entry in the signups table?

I manage a user registration process (on a multisite WP). However, some of my users can create new ones in a front page. If you look at this post you will find out the 3 stages for this: Use ...
Pierre's user avatar
  • 69
3 votes
2 answers
3k views

Create custom column in post table in wordpress

I want to add two custom field to table wp_posts, and that I need for my plugin. now to enable these fields I have changed core file of wordpress wordpress/wp-admin/post.php $data = compact( array( '...
anytime's user avatar
  • 51
3 votes
1 answer
2k views

BuddyPress: What's the use of wp_bp_xprofile_data table and how does it get updated? [closed]

I have a questions related to BuddyPress: What's the use of wp_bp_xprofile_data table? How does the data in the table get updated? And when any user updates his information - does the data in this ...
Debiprasad's user avatar
3 votes
1 answer
1k views

Include custom table into search results

How can I include custom tables into search results. My all custom tables has qa_ prefix and wordpress has default wp_ prefix
pixelngrain's user avatar
  • 1,370
3 votes
0 answers
2k views

Database with mixed collation (utf8mb4 & utf8_general_ci)

Each time I was uploading my WP install from offline to online, I was noticing strange characters in text and digging a bit I have discovered that wp-config.php on the online server was set to define('...
Riccardo's user avatar
  • 911
3 votes
0 answers
681 views

Visual Editor freezing on text highlight since 4.3

Ever since I updated my website to 4.3 my visual editor is freezing every time I try to highlight a piece of text, or even place my cursor someplace random. This only seems to be happening on the text ...
Dan's user avatar
  • 43
2 votes
1 answer
8k views

How to update BuddyPress xprofile fields programmatically? [closed]

I update user info using wp_update_user function. I also need to update the table wp_bp_xprofile_data. Is there any function, where I can update data on wp_bp_xprofile_data table?
Debiprasad's user avatar
2 votes
2 answers
5k views

Should I global $wpdb outside of any of my plugin's functions scope?

I know that the general advice to global variables is to not use them at all. Still, when doing something with the Wordpress database, it is required to do global $wpdb; to access the methods ...
Sven's user avatar
  • 371
2 votes
1 answer
144 views

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

So I logged on phpmyadmin, went to check out how data is stored in a table and saw it''s 'data' columns contents (pasted below): a:8:{i:2;O:8:"stdClass":2:{s:5:"label";s:6:"Vardas";s:5:"value";s:1:"A"...
Denialos's user avatar
  • 123
2 votes
1 answer
47 views

Why majority of fileds in wp_posts table prefixed with post_?

Why for example field in wp_posts table is called "post_title" instead of "title"? Is this somehow related to b2cafelog legacy code for backward capability? Or is there other explanation for this? ...
webvitaly's user avatar
  • 435
2 votes
3 answers
5k views

How to insert more than one row of data into a table at one time

I would like to populate a custom table, with more than one row of data at one time. If I delete the second array, it will insert one row of data. It won't add both rows at the same time though. How ...
user avatar
2 votes
3 answers
2k views

The plugin generated x characters of unexpected output, $wpdb not defined

I've written a simple Wordpress plugin to create a new database table. The new table ought to be created when the plugin is activated. When I try to activate the plugin, I get the following error: ...
cg433n's user avatar
  • 123
2 votes
1 answer
2k views

Get multiple db prefix with $wpdb

I have installed wordpress with question2answer as a single signon. The database created by wordpress with wp_ prefix and question2answer prefix is qa_ Now wordpress tables doesnt required to define ...
pixelngrain's user avatar
  • 1,370
2 votes
2 answers
4k views

Can't pass table to $wpdb->prepare

I'm having trouble passing a table variable to $wpdb->prepare(); Here is functioning code: $table = $wpdb->get_blog_prefix( $blog_id ) . 'my_table'; $voters = $wpdb->get_row($wpdb->prepare("...
Nick Budden's user avatar
2 votes
1 answer
1k views

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

I want to add the table controls for wp_editor(tinymce) initiated with teeny=>true. Here is what I have done so far (without success): <?php $tinymce_options = array('plugins' => "table", '...
sariDon's user avatar
  • 255
2 votes
1 answer
2k views

Tablepress won't update the table data [closed]

I'm new to wordpress and it's features. I want to show some data like below image. I could make it with tablepress plugin, but if the source CSV file changes, the table values won't change. How can I ...
mohammads's user avatar
  • 123
2 votes
2 answers
2k views

Get random row from custom table

I have custom table where I store quotes and author: function quote_install(){ global $wpdb; global $quote_db_version; $table_name = $wpdb->prefix . 'quote'; // create sql your table ...
Greg Skala's user avatar
2 votes
2 answers
2k views

how to change appearence of the content of default post list columns?

Speaking about backoffice here. I usually add columns and filters to the backoffice for certain custom post types. No problem here. BUt what if I would simply like to change something on the content ...
Luca Reghellin's user avatar
2 votes
1 answer
89 views

Return number of items in a table with post id

I am trying to return the number of reviews for a given page ID, I have this so far: <?php global $wpdb; $countreviews = $wpdb->get_var($wpdb->prepare("SELECT COUNT(ID) FROM $wpdb->...
fightstarr20's user avatar
  • 1,097
2 votes
1 answer
1k views

Table for plugin-list-category-post? [closed]

I'm using the list-category-post plugin - is it possible to display the list of posts in a table? I want to have a dynamic table showing all the posts in a category, so a user can search the table ...
mary hughes's user avatar
2 votes
1 answer
278 views

How can I add data to a custom column in the Users section of the wordpress backend?

Can anyone help me with adding data to a new User table column that I added? In the wordpress backend, in the Users section, I added a custom column called "Last Name". Now, I'd like to add last ...
sansae's user avatar
  • 189
2 votes
1 answer
647 views

HTML table from shortcode with multiple parameters

I've struck this problem, and I just can't solve it. I've come a long way with all the maths behind the table and the table being put out as a result of a function behind the shortcode. Then I also ...
D. Bleumink's user avatar
2 votes
1 answer
2k views

How to edit mySQL wp_posts table from plugin php?

I have a need to change a plugin that adds entries to the wp_posts table. Currently, it is lacking in that it cannot target some (other) plugin specific columns. I am endeavoring to edit the plugin so ...
user38365's user avatar
  • 274
2 votes
1 answer
139 views

What table is the media's sort order stored?

I see that your can sort media by a numbered order in the media gallery for a post. But what table is this order stored in? I want to use this order to also order the images the same way in my posts....
Jerry Tunin's user avatar
2 votes
1 answer
746 views

Custom fields on a virtual page

I've used Dave Jesch's solution for making virtual pages (from content temporarily saved in a custom database table, updated from an RSS every four hours). See more here: http://davejesch.com/...
Linda H's user avatar
  • 167
1 vote
2 answers
3k views

Creating table with plugin is not working

After reading many question and answers and many had asked the same question I have been following the same instruction as the people instructed but my bad it's not working I have used dbDelta($sql) ...
lost_in_magento's user avatar
1 vote
3 answers
8k views

How to get user ID during registration and add it to a custom table

I am trying to get the user ID during registration and automatically add that ID to my custom table. I am using the WP-Members plugin for registration. Is it possible to get user ID on the fly while ...
pixelngrain's user avatar
  • 1,370
1 vote
2 answers
193 views

Why my database table not created on activation?

I try to build an plugin with an custom db table. So I include the notifications.php in the plugin index.php file. If I do a die; in the public function init() (in notifications.php), it dies so it's ...
Maarten Heideman's user avatar
1 vote
1 answer
174 views

Adding a Table to the wordpress database

I am using the following script to add a table to the wordpress database, but nothing is happening. I am not sure what I am doing wrong. Any advice would be much appreciated. function ...
Victoria Whitehead's user avatar

1
2 3 4 5