mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Castaways on Gilligan's Isle
git-svn-id: https://develop.svn.wordpress.org/trunk@5090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -245,7 +245,7 @@ function category_exists($cat_name) {
|
||||
if (!$category_nicename = sanitize_title($cat_name))
|
||||
return 0;
|
||||
|
||||
return $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
|
||||
return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
|
||||
}
|
||||
|
||||
function wp_delete_user($id, $reassign = 'novalue') {
|
||||
@@ -299,6 +299,8 @@ function wp_insert_link($linkdata) {
|
||||
if ( !empty($link_id) )
|
||||
$update = true;
|
||||
|
||||
$link_id = (int) $link_id;
|
||||
|
||||
if( trim( $link_name ) == '' )
|
||||
return 0;
|
||||
$link_name = apply_filters('pre_link_name', $link_name);
|
||||
@@ -443,7 +445,7 @@ function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
|
||||
$old_categories = $wpdb->get_col("
|
||||
SELECT category_id
|
||||
FROM $wpdb->link2cat
|
||||
WHERE link_id = $link_ID");
|
||||
WHERE link_id = '$link_ID'");
|
||||
|
||||
if (!$old_categories) {
|
||||
$old_categories = array();
|
||||
@@ -456,10 +458,11 @@ function wp_set_link_cats($link_ID = 0, $link_categories = array()) {
|
||||
|
||||
if ($delete_cats) {
|
||||
foreach ($delete_cats as $del) {
|
||||
$del = (int) $del;
|
||||
$wpdb->query("
|
||||
DELETE FROM $wpdb->link2cat
|
||||
WHERE category_id = $del
|
||||
AND link_id = $link_ID
|
||||
WHERE category_id = '$del'
|
||||
AND link_id = '$link_ID'
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user