mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Avoid expensive NOT LIKE query. Filter in php instead.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c5c7eff703
commit
f78640043d
@ -2449,12 +2449,16 @@ function meta_form() {
|
||||
$keys = $wpdb->get_col( "
|
||||
SELECT meta_key
|
||||
FROM $wpdb->postmeta
|
||||
WHERE meta_key NOT LIKE '\_%'
|
||||
GROUP BY meta_key
|
||||
ORDER BY meta_key
|
||||
LIMIT $limit" );
|
||||
if ( $keys )
|
||||
if ( $keys ) {
|
||||
function filter_private_keys($key) {
|
||||
return ( 0 === strpos($key, '_') ) ? false : true;
|
||||
}
|
||||
$keys = array_filter($keys, 'filter_private_keys');
|
||||
natcasesort($keys);
|
||||
}
|
||||
?>
|
||||
<p><strong><?php _e( 'Add new custom field:' ) ?></strong></p>
|
||||
<table id="newmeta">
|
||||
|
Loading…
Reference in New Issue
Block a user