[wp-cvs] wordpress/wp-admin admin-functions.php, 1.55, 1.56 edit-page-form.php, 1.10, 1.11

Ryan Boren rboren at users.sourceforge.net
Wed Nov 24 00:12:48 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7791/wp-admin

Modified Files:
	admin-functions.php edit-page-form.php 
Log Message:
Do not allow a page to be its own parent.

Index: edit-page-form.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-page-form.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** edit-page-form.php	18 Nov 2004 19:40:35 -0000	1.10
--- edit-page-form.php	24 Nov 2004 00:12:46 -0000	1.11
***************
*** 35,39 ****
      <fieldset id="titlediv">
        <legend><?php _e('Page Title') ?></legend> 
! 	  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
      </fieldset>
  <fieldset id="commentstatusdiv">
--- 35,39 ----
      <fieldset id="titlediv">
        <legend><?php _e('Page Title') ?></legend> 
!  	  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
      </fieldset>
  <fieldset id="commentstatusdiv">

Index: admin-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** admin-functions.php	18 Nov 2004 19:51:30 -0000	1.55
--- admin-functions.php	24 Nov 2004 00:12:45 -0000	1.56
***************
*** 616,623 ****
  
  function parent_dropdown($default = 0, $parent = 0, $level = 0) {
! 	global $wpdb;
  	$items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
  	if ($items) {
  		foreach ($items as $item) {
  			$pad = str_repeat('&nbsp;', $level * 3);
  			if ($item->ID == $default)
--- 616,630 ----
  
  function parent_dropdown($default = 0, $parent = 0, $level = 0) {
! 	global $wpdb, $post_ID;
  	$items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
+ 
  	if ($items) {
  		foreach ($items as $item) {
+ 			// A page cannot be it's own parent.
+ 			if (!empty($post_ID)) {
+ 				if ($item->ID == $post_ID) {
+ 					continue;
+ 				}
+ 			}
  			$pad = str_repeat('&nbsp;', $level * 3);
  			if ($item->ID == $default)




More information about the cvs mailing list