• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

wordpress where to find category insert queries

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
springfresh
Asked:
springfresh
  • 2
  • 2
1 Solution
 
nanharbisonCommented:
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
 
springfreshAuthor Commented:
strange thing. But i commented this line. And new category insertion still works through admin panel :\
0
 
nanharbisonCommented:
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
 
dosthCommented:
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
 
dosthCommented:
did you get a chance to check it ?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now