Changeset 5281
- Timestamp:
- 04/17/2007 10:00:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r5279 r5281 940 940 // one has been provided. 941 941 $post_name = ""; 942 if( !empty($content_struct["wp_slug"])) {942 if(isset($content_struct["wp_slug"])) { 943 943 $post_name = $content_struct["wp_slug"]; 944 944 } 945 945 946 946 // Only use a password if one was given. 947 if( !empty($content_struct["wp_password"])) {947 if(isset($content_struct["wp_password"])) { 948 948 $post_password = $content_struct["wp_password"]; 949 949 } … … 955 955 956 956 // Only set the menu_order if it was provided. 957 if( !empty($content_struct["wp_page_order"])) {957 if(isset($content_struct["wp_page_order"])) { 958 958 $menu_order = $content_struct["wp_page_order"]; 959 959 } … … 962 962 963 963 // If an author id was provided then use it instead. 964 if(!empty($content_struct["wp_author_id"])) { 964 if( 965 isset($content_struct["wp_author_id"]) 966 && ($user->ID != $content_struct["wp_author_id"]) 967 ) { 965 968 switch($post_type) { 966 969 case "post": … … 990 993 $post_more = $content_struct['mt_text_more']; 991 994 992 $comment_status = (!isset($content_struct['mt_allow_comments'])) ? 993 get_option('default_comment_status') 994 : $content_struct['mt_allow_comments']; 995 996 $ping_status = (!isset($content_struct['mt_allow_pings'])) ? 997 get_option('default_ping_status') 998 : $content_struct['mt_allow_pings']; 995 if(isset($content_struct["mt_allow_comments"])) { 996 switch((int) $content_struct["mt_allow_comments"]) { 997 case 0: 998 $comment_status = "closed"; 999 break; 1000 case 1: 1001 $comment_status = "open"; 1002 break; 1003 default: 1004 $comment_status = get_option("default_comment_status"); 1005 break; 1006 } 1007 } 1008 1009 if(isset($content_struct["mt_allow_pings"])) { 1010 switch((int) $content_struct["mt_allow_pings"]) { 1011 case 0: 1012 $ping_status = "closed"; 1013 break; 1014 case 1: 1015 $ping_status = "open"; 1016 break; 1017 default: 1018 $ping_status = get_option("default_ping_status"); 1019 break; 1020 } 1021 } 999 1022 1000 1023 if ($post_more) { … … 1074 1097 } 1075 1098 1076 1099 $user = set_current_user(0, $user_login); 1077 1100 1078 1101 // The post_type defaults to post, but could also be page. … … 1103 1126 // Let WordPress manage slug if none was provided. 1104 1127 $post_name = ""; 1105 if( !empty($content_struct["wp_slug"])) {1128 if(isset($content_struct["wp_slug"])) { 1106 1129 $post_name = $content_struct["wp_slug"]; 1107 1130 } 1108 1131 1109 1132 // Only use a password if one was given. 1110 if( !empty($content_struct["wp_password"])) {1133 if(isset($content_struct["wp_password"])) { 1111 1134 $post_password = $content_struct["wp_password"]; 1112 1135 } … … 1118 1141 1119 1142 // Only set the menu_order if it was given. 1120 if( !empty($content_struct["wp_page_order"])) {1143 if(isset($content_struct["wp_page_order"])) { 1121 1144 $menu_order = $content_struct["wp_page_order"]; 1122 1145 } 1123 1146 1147 $post_author = $user->ID; 1148 1124 1149 // Only set the post_author if one is set. 1125 if(!empty($content_struct["wp_author_id"])) { 1150 if( 1151 isset($content_struct["wp_author_id"]) 1152 && ($user->ID != $content_struct["wp_author_id"]) 1153 ) { 1126 1154 switch($post_type) { 1127 1155 case "post": … … 1146 1174 // Only set ping_status if it was provided. 1147 1175 if(isset($content_struct["mt_allow_pings"])) { 1148 switch( $content_struct["mt_allow_pings"]) {1149 case "0":1176 switch((int) $content_struct["mt_allow_pings"]) { 1177 case 0: 1150 1178 $ping_status = "closed"; 1151 1179 break; 1152 case "1":1180 case 1: 1153 1181 $ping_status = "open"; 1154 1182 break; … … 1188 1216 1189 1217 if(isset($content_struct["mt_allow_comments"])) { 1190 $comment_status = $content_struct["mt_allow_comments"];1218 $comment_status = (int) $content_struct["mt_allow_comments"]; 1191 1219 } 1192 1220
Note: See TracChangeset
for help on using the changeset viewer.