HowTo: preselected meta keys for export
-
i have to export user data a lot but i am to lazy to select the meta keys. therefore i came up with this solution:
find that line of code:
echo "<option value='".esc_attr( $key )."' title='".esc_attr( $key )."' class='".$usermeta_class."'>$display_key</option>";
and replace it:
$checkarray = array( "Blog", // your custom meta key "Ausbildung" // another custom meta key ); if(in_array( $key,$checkarray)){ $selectedoption = 'selected="selected"'; }else{ $selectedoption = ''; } echo "<option ".$selectedoption." value='".esc_attr( $key )."' title='".esc_attr( $key )."' class='".$usermeta_class."'>$display_key</option>";
now the meta keys “Blog” and “Ausbildung” are selected by default
- The topic ‘HowTo: preselected meta keys for export’ is closed to new replies.