mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-02 09:07:59 +02:00
Make sure we have links to iterate over. fixes #2675
git-svn-id: http://svn.automattic.com/wordpress/trunk@3734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3d4f3629d0
commit
3d45520fff
@ -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…
Reference in New Issue
Block a user