Changeset 7991 for trunk/wp-app.php
- Timestamp:
- 05/25/2008 03:50:15 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-app.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-app.php
r7971 r7991 1 1 <?php 2 /* 3 * wp-app.php - Atom Publishing Protocol support for WordPress 4 * Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/ 5 * Modified by: Dougal Campbell, http://dougal.gunters.org/ 2 /** 3 * Atom Publishing Protocol support for WordPress 6 4 * 7 * Version: 1.0.5-dc 5 * @author Original by Elias Torres <http://torrez.us/archives/2006/08/31/491/> 6 * @author Modified by Dougal Campbell <http://dougal.gunters.org/> 7 * @version 1.0.5-dc 8 8 */ 9 9 10 /** 11 * WordPress is handling an Atom Publishing Protocol request. 12 * 13 * @var bool 14 */ 10 15 define('APP_REQUEST', true); 11 16 17 /** Set up WordPress environment */ 12 18 require_once('./wp-load.php'); 19 20 /** Post Template API */ 13 21 require_once(ABSPATH . WPINC . '/post-template.php'); 22 23 /** Atom Publishing Protocol Class */ 14 24 require_once(ABSPATH . WPINC . '/atomlib.php'); 25 26 /** Feed Handling API */ 15 27 require_once(ABSPATH . WPINC . '/feed.php'); 16 28 17 29 $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); 18 30 31 /** 32 * Whether to enable Atom Publishing Protocol Logging. 33 * 34 * @name app_logging 35 * @var int|bool 36 */ 19 37 $app_logging = 0; 20 38 21 // TODO: Should be an option somewhere 39 /** 40 * Whether to always authenticate user. Permanently set to true. 41 * 42 * @name always_authenticate 43 * @var int|bool 44 * @todo Should be an option somewhere 45 */ 22 46 $always_authenticate = 1; 23 47 48 /** 49 * log_app() - Writes logging info to a file. 50 * 51 * @uses $app_logging 52 * @package WordPress 53 * @subpackage Logging 54 * 55 * @param string $label Type of logging 56 * @param string $msg Information describing logging reason. 57 */ 24 58 function log_app($label,$msg) { 25 59 global $app_logging; … … 33 67 34 68 if ( !function_exists('wp_set_current_user') ) : 69 /** 70 * wp_set_current_user() - Sets the current WordPress User 71 * 72 * Pluggable function which is also found in pluggable.php. 73 * 74 * @see wp-includes/pluggable.php Documentation for this function. 75 * @uses $current_user Global of current user to test whether $id is the same. 76 * 77 * @param int $id The user's ID 78 * @param string $name Optional. The username of the user. 79 * @return WP_User Current user's User object 80 */ 35 81 function wp_set_current_user($id, $name = '') { 36 82 global $current_user; … … 45 91 endif; 46 92 93 /** 94 * wa_posts_where_include_drafts_filter() - Filter to add more post statuses 95 * 96 * @param string $where SQL statement to filter 97 * @return string Filtered SQL statement with added post_status for where clause 98 */ 47 99 function wa_posts_where_include_drafts_filter($where) { 48 $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where);49 return $where;100 $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where); 101 return $where; 50 102 51 103 } 52 104 add_filter('posts_where', 'wa_posts_where_include_drafts_filter'); 53 105 106 /** 107 * @internal 108 * Left undocumented to work on later. If you want to finish, then please do so. 109 * 110 * @package WordPress 111 * @subpackage Publishing 112 */ 54 113 class AtomServer { 55 114 … … 171 230 $categories_url = attribute_escape($this->get_categories_url()); 172 231 $media_url = attribute_escape($this->get_attachments_url()); 173 foreach ($this->media_content_types as $med) {174 $accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>";175 }232 foreach ($this->media_content_types as $med) { 233 $accepted_media_types = $accepted_media_types . "<accept>" . $med . "</accept>"; 234 } 176 235 $atom_prefix="atom"; 177 236 $atom_blogname=get_bloginfo('name');
Note: See TracChangeset
for help on using the changeset viewer.