WordPress.org

Forums

Where is this sql located? (4 posts)

  1. ballhogjoni
    Member
    Posted 3 years ago #

    SELECT count(*) as c FROM wp_posts WHERE ID IN (SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id = 18562) AND ID IN (SELECT post_id FROM wp_postmeta WHERE meta_key = '_menu_item_menu_item_parent' AND meta_value = '40138') ORDER BY menu_order;

  2. TCBarrett
    Member
    Posted 3 years ago #

    Looks like some code generated by a theme or plugin, rather than core. But I would think it is difficult to tell.

  3. ballhogjoni
    Member
    Posted 3 years ago #

    Anybody know anything about this?

  4. Sergey Biryukov
    WordPress Dev
    Posted 3 years ago #

    This query looks like the one from WPtouch Pro plugin, see wptouch_wordpress_menu_has_children() function in wptouch-pro/include/template-tags/wordpress-menu.php:

    $sql = $wpdb->prepare( "SELECT count(*) as c FROM {$wpdb->base_prefix}posts WHERE ID IN (SELECT object_id FROM {$wpdb->base_prefix}term_relationships WHERE term_taxonomy_id = %d) AND ID IN (SELECT post_id FROM {$wpdb->base_prefix}postmeta WHERE meta_key = '_menu_item_menu_item_parent' AND meta_value = '%d') ORDER BY menu_order", $settings->custom_menu_name, $parent );

    It's a premium plugin, not available in WP.org directory.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags