Make sure we have links to iterate over. fixes #2675
git-svn-id: https://develop.svn.wordpress.org/trunk@3734 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d58cfe86e0
commit
9c103c8d64
@ -522,7 +522,7 @@ function upgrade_210() {
|
|||||||
|
|
||||||
// Associate links to cats.
|
// Associate links to cats.
|
||||||
$links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
|
$links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
|
||||||
foreach ( $links as $link ) {
|
if ( !empty($links) ) foreach ( $links as $link ) {
|
||||||
$link_cat = $link_cat_id_map[$link->link_category];
|
$link_cat = $link_cat_id_map[$link->link_category];
|
||||||
$cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'");
|
$cat = $wpdb->get_row("SELECT * FROM $wpdb->link2cat WHERE link_id = '$link->link_id' AND category_id = '$link_cat'");
|
||||||
if (!$cat && 0 != $link->link_category) {
|
if (!$cat && 0 != $link->link_category) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user