page_attributes_meta_box [ WordPress Function ]
page_attributes_meta_box ( $post )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: post_categories_meta_box, link_categories_meta_box, language_attributes, post_author_meta_box, get_hidden_meta_boxes
Display page attributes form fields.
Source
<?php
function page_attributes_meta_box($post) {
$post_type_object = get_post_type_object($post->post_type);
if ( $post_type_object->hierarchical ) {
$dropdown_args = array(
'post_type' => $post->post_type,
'exclude_tree' => $post->ID,
'selected' => $post->post_parent,
'name' => 'parent_id',
'show_option_none' => __('(no parent)'),
'sort_column' => 'menu_order, post_title',
'echo' => 0,
);
$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
$pages = wp_dropdown_pages( $dropdown_args );
if ( ! empty($pages) ) {
?>
<p><strong><?php _e('Parent') ?></strong></p>
<label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label>
<?php echo $pages; ?>
<?php
} // end empty pages check
} // end hierarchical check.
if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
$template = !empty($post->page_template) ? $post->page_template : false;
?>
<p><strong><?php _e('Template') ?></strong></p>
<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
<option value='default'><?php _e('Default Template'); ?></option>
<?php page_template_dropdown($template); ?>
</select>
<?php
} ?>
<p><strong><?php _e('Order') ?></strong></p>
<p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p>
<p><?php if ( 'page' == $post->post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?></p>
<?php
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- page_attributes_meta_box (WordPress Function) - WPSeek.com
WordPress lookup for page_attributes_meta_box, a WordPress Function. wpseek .com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Docs for page meta-boxes.php
/wp-admin/includes/meta-boxes.php. Description. Description | ...
phpdoc.wordpress.org - WordPress › Support » Tags — page_attributes_meta_box
Username or Email Address Password (forgot?) Register · WordPress › Support » page_attributes_meta_box. Tag: page_attributes_meta_box Add New » ...
wordpress.org - Adding Page Attributes Metabox and Page Templates to the Posts Edit
Oct 10, 2010 ... How can I add the "Page Attributes" meta box and more specifically, the template switcher to the posts editor? I'm assuming this is code I will ...
wordpress.stackexchange.com