当前位置: 首页>>代码示例>>PHP>>正文


PHP page_rows函数代码示例

本文整理汇总了PHP中page_rows函数的典型用法代码示例。如果您正苦于以下问题:PHP page_rows函数的具体用法?PHP page_rows怎么用?PHP page_rows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了page_rows函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: page_rows

function page_rows($parent = 0, $level = 0, $pages = 0)
{
    global $wpdb, $class, $user_level, $post;
    if (!$pages) {
        $pages = $wpdb->get_results("SELECT * FROM {$wpdb->posts} WHERE post_status = 'static' ORDER BY menu_order");
    }
    if ($pages) {
        foreach ($pages as $post) {
            start_wp();
            if ($post->post_parent == $parent) {
                $post->post_title = wp_specialchars($post->post_title);
                $pad = str_repeat('— ', $level);
                $id = $post->ID;
                $class = 'alternate' == $class ? '' : 'alternate';
                ?>
<tr class='<?php 
                echo $class;
                ?>
'>
	<th scope="row"><?php 
                echo $post->ID;
                ?>
</th>
	<td>
	<?php 
                echo $pad;
                the_title();
                ?>
	</td>
	<td><?php 
                the_author();
                ?>
</td>
	<td><?php 
                echo mysql2date('Y-m-d g:i a', $post->post_modified);
                ?>
</td>
	<td><a href="<?php 
                the_permalink();
                ?>
" rel="permalink" class="edit"><?php 
                _e('View');
                ?>
</a></td>
	<td><?php 
                if ($user_level > $authordata->user_level or $user_login == $authordata->user_login) {
                    echo "<a href='post.php?action=edit&amp;post={$id}' class='edit'>" . __('Edit') . "</a>";
                }
                ?>
</td>
	<td><?php 
                if ($user_level > $authordata->user_level or $user_login == $authordata->user_login) {
                    echo "<a href='post.php?action=delete&amp;post={$id}' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \\'%s\\'\\n  \\'OK\\' to delete, \\'Cancel\\' to stop."), the_title('', '', 0)) . "')\">" . __('Delete') . "</a>";
                }
                ?>
</td>
</tr>

<?php 
                page_rows($id, $level + 1, $pages);
            }
        }
    } else {
        return false;
    }
}
开发者ID:BackupTheBerlios,项目名称:steampress-svn,代码行数:66,代码来源:admin-functions.php

示例2: print_column_headers

    print_column_headers('edit-pages');
    ?>
  </tr>
  </thead>

  <tfoot>
  <tr>
<?php 
    print_column_headers('edit-pages', false);
    ?>
  </tr>
  </tfoot>

  <tbody>
  <?php 
    page_rows($posts, $pagenum, $per_page);
    ?>
  </tbody>
</table>

<div class="tablenav">
<?php 
    if ($page_links) {
        echo "<div class='tablenav-pages'>{$page_links_text}</div>";
    }
    ?>

<div class="alignleft actions">
<select name="action2">
<option value="-1" selected="selected"><?php 
    _e('Bulk Actions');
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-pages.php

示例3: __

            if (current_user_can('edit_pages')) {
                echo "<a href='post.php?action=edit&amp;post={$post->ID}' class='edit'>" . __('Edit') . "</a>";
            }
            ?>
</td> 
    <td><?php 
            if (current_user_can('edit_pages')) {
                echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post={$post->ID}", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title('', '', 0))) . "' );\">" . __('Delete') . "</a>";
            }
            ?>
</td> 
  </tr>
<?php 
        }
    } else {
        page_rows();
    }
    ?>
</table> 

<div id="ajax-response"></div>

<?php 
} else {
    ?>
<p><?php 
    _e('No pages yet.');
    ?>
</p>
<?php 
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-pages.php

示例4: page_rows

function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true)
{
    global $wpdb, $class, $post;
    if (!$pages) {
        $pages = get_pages('sort_column=menu_order');
    }
    if (!$pages) {
        return false;
    }
    foreach ($pages as $post) {
        setup_postdata($post);
        if ($hierarchy && $post->post_parent != $parent) {
            continue;
        }
        $post->post_title = wp_specialchars($post->post_title);
        $pad = str_repeat('&#8212; ', $level);
        $id = (int) $post->ID;
        $class = 'alternate' == $class ? '' : 'alternate';
        ?>
  <tr id='page-<?php 
        echo $id;
        ?>
' class='<?php 
        echo $class;
        ?>
'>
    <th scope="row" style="text-align: center"><?php 
        echo $post->ID;
        ?>
</th>
    <td>
      <?php 
        echo $pad;
        the_title();
        ?>
    </td>
    <td><?php 
        the_author();
        ?>
</td>
    <td><?php 
        if ('0000-00-00 00:00:00' == $post->post_modified) {
            _e('Unpublished');
        } else {
            echo mysql2date(__('Y-m-d g:i a'), $post->post_modified);
        }
        ?>
</td>
	<td><a href="<?php 
        the_permalink();
        ?>
" rel="permalink" class="view"><?php 
        _e('View');
        ?>
</a></td>
    <td><?php 
        if (current_user_can('edit_page', $id)) {
            echo "<a href='page.php?action=edit&amp;post={$id}' class='edit'>" . __('Edit') . "</a>";
        }
        ?>
</td>
    <td><?php 
        if (current_user_can('delete_page', $id)) {
            echo "<a href='" . wp_nonce_url("page.php?action=delete&amp;post={$id}", 'delete-page_' . $id) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . js_escape(sprintf(__("You are about to delete the '%s' page.\n'OK' to delete, 'Cancel' to stop."), get_the_title())) . "' );\">" . __('Delete') . "</a>";
        }
        ?>
</td>
  </tr>

<?php 
        if ($hierarchy) {
            page_rows($id, $level + 1, $pages);
        }
    }
}
开发者ID:64kbytes,项目名称:stayinba,代码行数:75,代码来源:template.php

示例5: page_rows

function page_rows($parent = 0, $level = 0, $pages = 0)
{
    global $wpdb, $class, $post;
    if (!$pages) {
        $pages = $wpdb->get_results("SELECT * FROM {$wpdb->posts} WHERE post_status = 'static' ORDER BY menu_order");
    }
    if ($pages) {
        foreach ($pages as $post) {
            start_wp();
            if ($post->post_parent == $parent) {
                $post->post_title = wp_specialchars($post->post_title);
                $pad = str_repeat('&#8212; ', $level);
                $id = $post->ID;
                $class = 'alternate' == $class ? '' : 'alternate';
                ?>
  <tr id='page-<?php 
                echo $id;
                ?>
' class='<?php 
                echo $class;
                ?>
'> 
    <th scope="row"><?php 
                echo $post->ID;
                ?>
</th> 
    <td>
      <?php 
                echo $pad;
                the_title();
                ?>
 
    </td> 
    <td><?php 
                the_author();
                ?>
</td>
    <td><?php 
                echo mysql2date('Y-m-d g:i a', $post->post_modified);
                ?>
</td> 
	<td><a href="<?php 
                the_permalink();
                ?>
" rel="permalink" class="edit"><?php 
                _e('View');
                ?>
</a></td>
    <td><?php 
                if (current_user_can('edit_pages')) {
                    echo "<a href='post.php?action=edit&amp;post={$id}' class='edit'>" . __('Edit') . "</a>";
                }
                ?>
</td> 
    <td><?php 
                if (current_user_can('edit_pages')) {
                    echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post={$id}", 'delete-post_' . $id) . "' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), js_escape(get_the_title())) . "' );\">" . __('Delete') . "</a>";
                }
                ?>
</td> 
  </tr> 

<?php 
                page_rows($id, $level + 1, $pages);
            }
        }
    } else {
        return false;
    }
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:70,代码来源:admin-functions.php

示例6: edit_post

         $data['post_status'] = 'private';
     } else {
         $data['post_status'] = $data['_status'];
     }
     if (empty($data['comment_status'])) {
         $data['comment_status'] = 'closed';
     }
     if (empty($data['ping_status'])) {
         $data['ping_status'] = 'closed';
     }
     // update the post
     edit_post();
     $post = array();
     if ('page' == $_POST['post_type']) {
         $post[] = get_post($_POST['post_ID']);
         page_rows($post);
     } elseif ('post' == $_POST['post_type']) {
         $mode = $_POST['post_view'];
         $post[] = get_post($_POST['post_ID']);
         post_rows($post);
     }
     exit;
     break;
 case 'inline-save-tax':
     check_ajax_referer('taxinlineeditnonce', '_inline_edit');
     if (!current_user_can('manage_categories')) {
         die(__('Cheatin&#8217; uh?'));
     }
     if (!isset($_POST['tax_ID']) || !($id = (int) $_POST['tax_ID'])) {
         die(-1);
     }
开发者ID:nagyist,项目名称:laura-wordpress,代码行数:31,代码来源:admin-ajax.php

示例7: vicuna_list_pages

function vicuna_list_pages()
{
    global $wpdb, $class, $post;
    // Query pages.
    $pages = get_pages('');
    if (!empty($pages)) {
        echo "<table>\n";
        foreach ($pages as $post) {
            setup_postdata($post);
            if ('0000-00-00 00:00:00' == $post->post_modified) {
                continue;
            }
            if ($hierarchy && $post->post_parent != $parent) {
                continue;
            }
            $post->post_title = wp_specialchars($post->post_title);
            $pad = str_repeat('&#8212; ', $level);
            $id = (int) $post->ID;
            $class = 'alternate' == $class ? '' : 'alternate';
            ?>
		<tr id='page-<?php 
            echo $id;
            ?>
' class='<?php 
            echo $class;
            ?>
'>
			<th scope="row" style="text-align: center"><?php 
            echo $post->ID;
            ?>
</th>
			<td>
				<?php 
            echo $pad;
            the_title();
            ?>
			</td>
			<td><?php 
            the_author();
            ?>
</td>
			<td><?php 
            echo mysql2date(__('Y-m-d g:i a'), $post->post_modified);
            ?>
</td>
			<td><a href="<?php 
            the_permalink();
            ?>
" rel="permalink" class="view"><?php 
            _e('View');
            ?>
</a></td>
		</tr>
	<?php 
            if ($hierarchy) {
                page_rows($id, $level + 1, $pages);
            }
        }
        echo "</table>\n";
    }
    return $output;
}
开发者ID:nakaji0213,项目名称:wp.vicuna.ext,代码行数:62,代码来源:widgets.php

示例8: wp_manage_pages_columns

  <tr>
<?php $posts_columns = wp_manage_pages_columns(); ?>
<?php foreach($posts_columns as $post_column_key => $column_display_name) {
	if ( 'cb' === $post_column_key )
		$class = ' class="check-column"';
	elseif ( 'comments' === $post_column_key )
		$class = ' class="num"';
	else
		$class = '';
?>
	<th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th>
<?php } ?>
  </tr>
  </thead>
  <tbody>
  <?php page_rows($posts); ?>
  </tbody>
</table>

</form>

<div id="ajax-response"></div>

<?php
} else {
?>
</form>
<p><?php _e('No pages found.') ?></p>
<?php
} // end if ($posts)
?>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-pages.php

示例9: _e

    _e('Owner');
    ?>
</th>
	<th scope="col"><?php 
    _e('Updated');
    ?>
</th>
	<th scope="col" colspan="3" style="text-align: center"><?php 
    _e('Action');
    ?>
</th>
  </tr>
  </thead>
  <tbody id="the-list">
<?php 
    page_rows(0, 0, $posts, $all);
    ?>
  </tbody>
</table>

<div id="ajax-response"></div>

<?php 
} else {
    ?>
<p><?php 
    _e('No pages yet.');
    ?>
</p>
<?php 
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-pages.php

示例10: page_rows

        ?>
	<th scope="col"<?php 
        echo $class;
        ?>
><?php 
        echo $column_display_name;
        ?>
</th>
<?php 
    }
    ?>
  </tr>
  </thead>
  <tbody>
  <?php 
    page_rows($posts);
    ?>
  </tbody>
</table>

</form>

<div id="ajax-response"></div>

<?php 
} else {
    ?>
</form>
<p><?php 
    _e('No pages found.');
    ?>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-pages.php


注:本文中的page_rows函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。