function wototo_thing_search_html()
{
    ?>
	<h4>Add Items</h4>
	<table><tbody><tr>
		<td>Title</td>
		<td>Category</td>
		<td>Type</td>
		<td>Author</td>
		<td>Sort by/Reverse</td>
	</tr>
	<!-- <tr><td>Status</td><td>
		<select name="wototo_thing_search_status">
			<option value="">Any</option>
			<option value="publish">Published</option>
		</select></td></tr> -->
	<tr>
		<td><input type="search" name="wototo_thing_search_search"/></td>
   		<td><select name="wototo_thing_search_category">
			<option value="0">&mdash;Any&mdash;</option>
<?php 
    wototo_category_options_html();
    ?>
		</select></td>
		<td><select name="wototo_thing_search_type">
			<option value="post">Post</option>
			<option value="page">Page</option>
			<option value="anywhere_map_post">Map Post</option>
		</select></td>
		<td><select name="wototo_thing_search_author">
			<option value="1">You</option>
			<option value="0">Anyone</option>
		</select></td>
		<td><select name="wototo_thing_search_orderby">
			<option value="title">Title</option>
			<option value="date">Date</option>
			<option value="modified">Modified</option>
		</select>/<input name="wototo_thing_search_reverse" type="checkbox"/></td>
	</tr>
	<tr>
		<td id="wototo_thing_search_spinner"><input type="button" value="Search" name="wototo_thing_search" id="wototo_thing_search_id"/><span class="spinner"></span></td>
	</tr>
	</tbody></table>
	<div id="wototo_thing_search_result"></div>
<?php 
}
function postselector_custom_box($post)
{
    $postselector_input_category = get_post_meta($post->ID, '_postselector_input_category', true);
    ?>
    <label for="postselector_input_category_id">Category of posts to select from:</label><br/>
    <select name="postselector_input_category" id="postselector_input_category_id">
        <option value="0"><?php 
    printf('&mdash; %s &mdash;', esc_html__('Select a Category'));
    ?>
</option>
<?php 
    wototo_category_options_html($postselector_input_category);
    ?>
  </select><br/>
    <!-- <p>Current value: <?php 
    echo $postselector_input_category;
    ?>
</p> -->
    <label for="postselector_output_app_id">Output selection to Wototo app (editable by you):</label></br/>
    <select name="postselector_output_app" id="postselector_output_app_id">
        <option value="0"><?php 
    printf('&mdash; %s &mdash;', esc_html__('None'));
    ?>
</option>
<?php 
    $postselector_output_app = get_post_meta($post->ID, '_postselector_output_app', true);
    $apps = get_posts(array('post_type' => 'wototo_app', 'orderby' => 'post_title'));
    foreach ($apps as $app) {
        if (current_user_can('edit_post', $app->ID)) {
            $selected = $postselector_output_app == $app->ID ? 'selected' : '';
            ?>
        <option value="<?php 
            echo $app->ID;
            ?>
" <?php 
            echo $selected;
            ?>
 ><?php 
            echo esc_html($app->post_title);
            ?>
</option>
<?php 
        }
    }
    ?>
    </select><br/>
<?php 
    $postselector_use_union = get_post_meta($post->ID, '_postselector_use_union', true);
    $postselector_union_url = get_post_meta($post->ID, '_postselector_union_url', true);
    ?>
    <label><input type="hidden" name="postselector_use_union_shown" value="1"/>
       <input type="checkbox" name="postselector_use_union" <?php 
    echo $postselector_use_union ? 'checked' : '';
    ?>
 />Share selection via Union server:</label><br/>
    <input type="text" name="postselector_union_url" value="<?php 
    esc_attr($postselector_union_url);
    ?>
" placeholder="tryunion.com" /><br/>
<?php 
}