Beispiel #1
0
/**
 * Displays the metaboxes for a given post type
 *
 * @return void
 * @author Jared Lang
 **/
function show_meta_boxes($post)
{
    #Register custom post types metaboxes
    foreach (installed_custom_post_types() as $custom_post_type) {
        if (post_type($post) == $custom_post_type->options('name')) {
            $meta_box = $custom_post_type->metabox();
            break;
        }
    }
    return _show_meta_boxes($post, $meta_box);
}
					
					<h4>(post type)-list</h4>
					<p>Outputs a list of a given post type filtered by arbitrary taxonomies, for 
					example a tag or category.  A default output can be added for when no objects 
					matching the criteria are found.  Available attributes:</p>
					
					<table>
					<tr>
						<th scope="col">Post Type</th>
						<th scope="col">Shortcode Call</th>
						<th scope="col">Available Taxonomy Filters</th>
						<th scope="col">Additional Filters</th>
					</tr>
					
						<?php 
$custom_post_types = installed_custom_post_types();
foreach ($custom_post_types as $custom_post_type) {
    ?>
					<tr>
						<td><?php 
    echo $custom_post_type->singular_name;
    ?>
</td>
						<td><?php 
    echo $custom_post_type->name;
    ?>
-list</td>
								
						<td>
							<ul>
							<?php 
Beispiel #3
0
function register_custom_fields()
{
    foreach (installed_custom_post_types() as $custom_post_type) {
        $custom_post_type->register_fields();
    }
}
Beispiel #4
0
function register_custom_post_type_fields()
{
    foreach (installed_custom_post_types() as $custom_post_type) {
        $custom_post_type->register_metaboxes();
    }
    flush_rewrite_rules_if_necessary();
}