Solved

wordpress where to find category insert queries

Posted on 2008-06-14
6
331 Views
Last Modified: 2012-06-21
hello,
simple question:
in which wordpress file, there are mysql query, which is inserting new category through admin panel. I examined whole code and didnt found that thing. Let me know, thanks!
0
Comment
Question by:springfresh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 17

Expert Comment

by:nanharbison
ID: 21786512
the name of the table in the database that stores categories is called:
terms
here is the insert statement:
$wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')");
(line 66 on my computer)
I found this insert statement in a file in the includes folder called upgrade.php. There is a file in this folder called category.php, but the functions there all prepare the data to display it in the blog
0
 

Author Comment

by:springfresh
ID: 21787783
strange thing. But i commented this line. And new category insertion still works through admin panel :\
0
 
LVL 17

Expert Comment

by:nanharbison
ID: 21789477
hhhmm, the same query is on line 569 and 642. these two are the same query but get called depending on the version of the database you are using. I don't know what you are using, so comment out both of them.
0
 
LVL 15

Accepted Solution

by:
dosth earned 500 total points
ID: 21855931
it will be in wp-includes\wp-db.php

line 325 -

function insert($table, $data) {

this will be a generic function called from

wp-includes\taxonomy.php line 1163

function wp_insert_term( $term, $taxonomy, $args = array() ) {
0
 
LVL 15

Expert Comment

by:dosth
ID: 21890145
did you get a chance to check it ?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to use 2 ON statements in inner join 3 40
Building a glossary into your website 9 53
Dump data from mysql to xls php 10 49
Secure registration PHP 7 30
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

731 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question