WordPress.org

Support

Support » How-To and Troubleshooting » Where is this sql located?

Where is this sql located?

  • 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;

Viewing 3 replies - 1 through 3 (of 3 total)
  • Looks like some code generated by a theme or plugin, rather than core. But I would think it is difficult to tell.

    Anybody know anything about this?

    Moderator Sergey Biryukov

    @sergeybiryukov

    WordPress Dev

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where is this sql located?’ is closed to new replies.