Пример #1
0
/**
 * Returns page positions infos : 'order','parent','depth','nb_children','children',
 * 'all_siblings','siblings_no_current','siblings_before','siblings_after','previous_sibling','next_sibling'
 */
function apm_get_page_position_infos($page_id = 0)
{
    return Apm::get_page_tree_positions($page_id);
}
<?php

/**
 * Modified version of wp-admin/includes/meta-boxes.php::page_attributes_meta_box() 
 */
$post_type_object = get_post_type_object($post->post_type);
if ($post->post_type == 'page') {
    $is_page_in_apm_tree = Apm::get_page_is_in_apm_tree();
    if ($is_page_in_apm_tree) {
        $marked = Apm::get_page_flag();
        $marked = $marked > 0;
        $page_tree_positions = Apm::get_page_tree_positions();
        $page_apm_id = Apm::get_page_apm_id();
        ?>
		
		<?php 
        if (ApmAddons::addon_is_on('flagged_pages')) {
            ?>
			<div id="apm_flag_links_wrapper">
				<a href="#" id="apm_unflag_page" style="<?php 
            echo $marked ? '' : 'display:none';
            ?>
" rel="<?php 
            echo $page_apm_id;
            ?>
"><img src="<?php 
            echo plugin_dir_url(dirname(dirname(__FILE__)));
            ?>
img/red_tag.png" alt="<?php 
            _e('Page flagged : click here to unflag', ApmConfig::i18n_domain);
            ?>