Make WordPress Core

Changeset 7991 for trunk/wp-app.php


Ignore:
Timestamp:
05/25/2008 03:50:15 PM (18 years ago)
Author:
ryan
Message:

File file level phpdoc from jacobsantos. see #7037

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-app.php

    r7971 r7991  
    11<?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
    64 *
    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
    88 */
    99
     10/**
     11 * WordPress is handling an Atom Publishing Protocol request.
     12 *
     13 * @var bool
     14 */
    1015define('APP_REQUEST', true);
    1116
     17/** Set up WordPress environment */
    1218require_once('./wp-load.php');
     19
     20/** Post Template API */
    1321require_once(ABSPATH . WPINC . '/post-template.php');
     22
     23/** Atom Publishing Protocol Class */
    1424require_once(ABSPATH . WPINC . '/atomlib.php');
     25
     26/** Feed Handling API */
    1527require_once(ABSPATH . WPINC . '/feed.php');
    1628
    1729$_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] );
    1830
     31/**
     32 * Whether to enable Atom Publishing Protocol Logging.
     33 *
     34 * @name app_logging
     35 * @var int|bool
     36 */
    1937$app_logging = 0;
    2038
    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 */
    2246$always_authenticate = 1;
    2347
     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 */
    2458function log_app($label,$msg) {
    2559    global $app_logging;
     
    3367
    3468if ( !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 */
    3581function wp_set_current_user($id, $name = '') {
    3682    global $current_user;
     
    4591endif;
    4692
     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 */
    4799function 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;
    50102
    51103}
    52104add_filter('posts_where', 'wa_posts_where_include_drafts_filter');
    53105
     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 */
    54113class AtomServer {
    55114
     
    171230        $categories_url = attribute_escape($this->get_categories_url());
    172231        $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        }
    176235        $atom_prefix="atom";
    177236        $atom_blogname=get_bloginfo('name');
Note: See TracChangeset for help on using the changeset viewer.