Make WordPress Core

Changeset 7991


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

File file level phpdoc from jacobsantos. see #7037

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r4495 r7991  
    11<?php
    2 /* Short and sweet */
     2/**
     3 * Front to the WordPress application. Most of WordPress is loaded through this
     4 * file. This file doesn't do anything, but loads the file which does and tells
     5 * WordPress to load the theme.
     6 *
     7 * @package WordPress
     8 */
     9
     10/**
     11 * Tells WordPress to load the WordPress theme and output it.
     12 *
     13 * @var bool
     14 */
    315define('WP_USE_THEMES', true);
     16
     17/** Loads the WordPress Environment and Template */
    418require('./wp-blog-header.php');
    519?>
  • 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');
  • trunk/wp-atom.php

    r7971 r7991  
    11<?php
     2/**
     3 * Outputs the Atom feed XML format using the feed-atom.php file in wp-includes
     4 * folder. This file only sets the feed format and includes the feed-atom.php.
     5 *
     6 * This file is no longer used in WordPress and while it is not deprecated now.
     7 * This file will most likely be deprecated or removed in a later version.
     8 *
     9 * The link for the atom feed is /index.php?feed=atom with permalinks off.
     10 *
     11 * @package WordPress
     12 */
    213
    314if (empty($wp)) {
  • trunk/wp-blog-header.php

    r7971 r7991  
    11<?php
     2/**
     3 * Loads the WordPress environment and template.
     4 *
     5 * @package WordPress
     6 */
    27
    38if ( !isset($wp_did_header) ) {
  • trunk/wp-comments-post.php

    r7971 r7991  
    11<?php
     2/**
     3 * Handles Comment Post to WordPress and prevents duplicate comment posting.
     4 *
     5 * @package @WordPress
     6 */
     7
    28if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
    39    header('Allow: POST');
     
    612    exit;
    713}
     14
     15/** Sets up the WordPress Environment. */
    816require( dirname(__FILE__) . '/wp-load.php' );
    917
  • trunk/wp-commentsrss2.php

    r7971 r7991  
    11<?php
     2/**
     3 * Outputs the RSS2 XML format comment feed using the feed-rss2.php file in
     4 * wp-includes folder. This file only sets the feed format and includes the
     5 * feed-rss2-comments.php.
     6 *
     7 * This file is no longer used in WordPress and while it is not deprecated now.
     8 * This file will most likely be deprecated or removed in a later version.
     9 *
     10 * The link for the rss2 comment feed is /index.php?feed=rss2&withcomments=1
     11 * with permalinks off.
     12 *
     13 * @package WordPress
     14 */
    215
    316if (empty($wp)) {
  • trunk/wp-cron.php

    r7971 r7991  
    11<?php
     2/**
     3 * WordPress Cron Implementation for hosts, which do not offer CRON or for which
     4 * the user has not setup a CRON job pointing to this file.
     5 *
     6 * The HTTP request to this file will not slow down the visitor who happens to
     7 * visit when the cron job is needed to run.
     8 *
     9 * @package WordPress
     10 */
     11
    212ignore_user_abort(true);
    3 define('DOING_CRON', TRUE);
     13
     14/**
     15 * Tell WordPress we are doing the CRON task.
     16 *
     17 * @var bool
     18 */
     19define('DOING_CRON', true);
     20/** Setup WordPress environment */
    421require_once('./wp-load.php');
    522
     
    1633if (!is_array($crons) || $keys[0] > time())
    1734    return;
     35
    1836foreach ($crons as $timestamp => $cronhooks) {
    1937    if ($timestamp > time()) break;
  • trunk/wp-feed.php

    r4495 r7991  
    11<?php
     2/**
     3 * Outputs the RSS2 feed XML format. This file is a shortcut or compatibility
     4 * layer for easily finding the RSS feed for the site. It loads WordPress using
     5 * the wp-blog-header.php file and running do_feed() function.
     6 *
     7 * @see do_feed() Used to display the RSS2 feed
     8 *
     9 * This file is no longer used in WordPress and while it is not deprecated now.
     10 * This file will most likely be deprecated or removed in a later version.
     11 *
     12 * The link for the rss2 feed is /index.php?feed=rss2 with permalinks off.
     13 *
     14 * @package WordPress
     15 */
    216
    317if (empty($doing_rss)) {
  • trunk/wp-links-opml.php

    r7971 r7991  
    11<?php
     2/**
     3 * Outputs the OPML XML format for getting the links defined in the link
     4 * administration. This can be used to export links from one blog over to
     5 * another. Links aren't exported by the WordPress export, so this file handles
     6 * that.
     7 *
     8 * This file is not added by default to WordPress theme pages when outputting
     9 * feed links. It will have to be added manually for browsers and users to pick
     10 * up that this file exists.
     11 *
     12 * @package WordPress
     13 */
    214
    315if (empty($wp)) {
  • trunk/wp-load.php

    r7971 r7991  
    11<?php
     2/**
     3 * Bootstrap file for setting the ABSPATH constant
     4 * and loading the wp-config.php file. The wp-config.php
     5 * file will then load the wp-settings.php file, which
     6 * will then set up the WordPress environment.
     7 *
     8 * If the wp-config.php file is not found then an error
     9 * will be displayed asking the visitor to set up the
     10 * wp-config.php file.
     11 *
     12 * Also made to work in the wp-admin/ folder, because it
     13 * will look in the parent directory if the file is not
     14 * found in the current directory.
     15 *
     16 * @package WordPress
     17 */
    218
    3 // Define ABSPATH as this files directory
     19/** Define ABSPATH as this files directory */
    420define( 'ABSPATH', dirname(__FILE__) . '/' );
    521
    622if ( file_exists( ABSPATH . 'wp-config.php') ) {
    723
    8     // The config file resides in ABSPATH
     24    /** The config file resides in ABSPATH */
    925    require_once( ABSPATH . 'wp-config.php' );
    1026
    1127} elseif ( file_exists( dirname(ABSPATH) . '/wp-config.php' ) ) {
    1228
    13     // The config file resides one level below ABSPATH
     29    /** The config file resides one level below ABSPATH */
    1430    require_once( dirname(ABSPATH) . '/wp-config.php' );
    1531
  • trunk/wp-login.php

    r7979 r7991  
    11<?php
     2/**
     3 *
     4 * @package WordPress
     5 */
     6
     7/** Make sure that the WordPress bootstrap has ran before continuing. */
    28require( dirname(__FILE__) . '/wp-load.php' );
    39
    4 // Rather than duplicating this HTML all over the place, we'll stick it in function
     10/**
     11 * login_header() - Outputs the header for the login page
     12 *
     13 * @package WordPress
     14 * @uses do_action() Calls the 'login_head' for outputting HTML in the Login
     15 *      header.
     16 * @uses apply_filters() Calls 'login_headerurl' for the top login link.
     17 * @uses apply_filters() Calls 'login_headertitle' for the top login title.
     18 * @uses apply_filters() Calls 'login_message' on the message to display in the
     19 *      header.
     20 * @uses $error The error global, which is checked for displaying errors.
     21 *
     22 * @param string $title Optional. WordPress Login Page title to display in
     23 *      <title/> element.
     24 * @param string $message Optional. Message to display in header.
     25 * @param WP_Error $wp_error Optional. WordPress Error Object
     26 */
    527function login_header($title = 'Login', $message = '', $wp_error = '') {
    628    global $error;
     
    5779} // End of login_header()
    5880
     81/**
     82 * retrieve_password() - Handles sending password retrieval email to user
     83 *
     84 * {@internal Missing Long Description}}
     85 *
     86 * @uses $wpdb WordPress Database object
     87 *
     88 * @return bool|WP_Error True: when finish. WP_Error on error
     89 */
    5990function retrieve_password() {
    6091    global $wpdb;
     
    111142}
    112143
     144/**
     145 * reset_password() - Handles resetting the user's password
     146 *
     147 * {@internal Missing Long Description}}
     148 *
     149 * @uses $wpdb WordPress Database object
     150 *
     151 * @param string $key Hash to validate sending user's password
     152 * @return bool|WP_Error
     153 */
    113154function reset_password($key) {
    114155    global $wpdb;
     
    145186}
    146187
     188/**
     189 * register_new_user() - Handles registering a new user
     190 *
     191 * {@internal Missing Long Description}}
     192 *
     193 * @param string $user_login User's username for logging in
     194 * @param string $user_email User's email address to send password and add
     195 * @return int|WP_Error Either user's ID or error on failure.
     196 */
    147197function register_new_user($user_login, $user_email) {
    148198    $errors = new WP_Error();
  • trunk/wp-mail.php

    r7971 r7991  
    11<?php
     2/**
     3 * Gets the email message from the user's mailbox to add as
     4 * a WordPress post. Will only run if this is setup and enabled.
     5 *
     6 * @package WordPress
     7 */
     8
     9/** Make sure that the WordPress bootstrap has ran before continuing. */
    210require(dirname(__FILE__) . '/wp-load.php');
    311
     12/** Get the POP3 class for which to access the mailbox. */
    413require_once(ABSPATH.WPINC.'/class-pop3.php');
    514
     15// WTF is this? Use constants instead.
    616error_reporting(2037);
    717
  • trunk/wp-pass.php

    r7971 r7991  
    11<?php
     2/**
     3 * Creates the password cookie and redirects back to where the
     4 * visitor was before.
     5 *
     6 * @package WordPress
     7 */
     8
     9/** Make sure that the WordPress bootstrap has ran before continuing. */
    210require( dirname(__FILE__) . '/wp-load.php');
    311
  • trunk/wp-rdf.php

    r7971 r7991  
    1 <?php /* RDF 1.0 generator, original version by garym@teledyn.com */
     1<?php
     2/**
     3 * Outputs the RDF feed using the feed-rdf.php
     4 * file in wp-includes folder.
     5 *
     6 * This file only sets the feed format and includes the
     7 * feed-rdf.php.
     8 *
     9 * This file is no longer used in WordPress and while it is
     10 * not deprecated now. This file will most likely be
     11 * deprecated or removed in a later version.
     12 *
     13 * @package WordPress
     14 */
    215
    316if (empty($wp)) {
  • trunk/wp-register.php

    r7971 r7991  
    11<?php
    2 
    3 # This file is deprecated, but you shouldn't have been linking to it directly anyway :P
    4 # Use wp_register() to create a registration link instead, it's much better ;)
     2/**
     3 * Used to be the page which displayed the registration form.
     4 *
     5 * This file is no longer used in WordPress and is
     6 * deprecated.
     7 *
     8 * @package WordPress
     9 * @deprecated Use wp_register() to create a registration link instead
     10 */
    511
    612require('./wp-load.php');
  • trunk/wp-rss.php

    r7971 r7991  
    11<?php
     2/**
     3 * Outputs the RSS feed RDF format using the feed-rss.php
     4 * file in wp-includes folder.
     5 *
     6 * This file only sets the feed format and includes the
     7 * feed-rss.php.
     8 *
     9 * This file is no longer used in WordPress and while it is
     10 * not deprecated now. This file will most likely be
     11 * deprecated or removed in a later version.
     12 *
     13 * @package WordPress
     14 */
    215
    316if (empty($wp)) {
  • trunk/wp-rss2.php

    r7971 r7991  
    11<?php
     2/**
     3 * Outputs the RSS2 feed XML format using the feed-rss2.php file in wp-includes
     4 * folder. This file only sets the feed format and includes the feed-rss2.php.
     5 *
     6 * This file is no longer used in WordPress and while it is not deprecated now.
     7 * This file will most likely be deprecated or removed in a later version.
     8 *
     9 * The link for the rss2 feed is /index.php?feed=rss2 with permalinks off.
     10 *
     11 * @package WordPress
     12 */
    213
    314if (empty($wp)) {
  • trunk/wp-trackback.php

    r7971 r7991  
    11<?php
     2/**
     3 * Handle Trackbacks and Pingbacks sent to WordPress
     4 *
     5 * @package WordPress
     6 */
    27
    38if (empty($wp)) {
     
    611}
    712
     13/**
     14 * trackback_response() - Respond with error or success XML message
     15 *
     16 * @param int|bool $error Whether there was an error or not
     17 * @param string $error_message Error message if an error occurred
     18 */
    819function trackback_response($error = 0, $error_message = '') {
    920    header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
  • trunk/xmlrpc.php

    r7971 r7991  
    11<?php
    2 
     2/**
     3 * XML-RPC protocol support for WordPress
     4 *
     5 * @license GPL v2 <./license.txt>
     6 * @package WordPress
     7 */
     8
     9/**
     10 * Whether this is a XMLRPC Request
     11 *
     12 * @var bool
     13 */
    314define('XMLRPC_REQUEST', true);
    415
     
    1223}
    1324
    14 # fix for mozBlog and other cases where '<?xml' isn't on the very first line
     25// fix for mozBlog and other cases where '<?xml' isn't on the very first line
    1526if ( isset($HTTP_RAW_POST_DATA) )
    1627    $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
    1728
     29/** Include the bootstrap for setting up WordPress environment */
    1830include('./wp-load.php');
    1931
     
    4658// error_reporting(0);
    4759
    48 $post_default_title = ""; // posts submitted via the xmlrpc interface get that title
    49 
     60/**
     61 * Posts submitted via the xmlrpc interface get that title
     62 * @name post_default_title
     63 * @var string
     64 */
     65$post_default_title = "";
     66
     67/**
     68 * Whether to enable XMLRPC Logging.
     69 *
     70 * @name xmlrpc_logging
     71 * @var int|bool
     72 */
    5073$xmlrpc_logging = 0;
    5174
     75/**
     76 * logIO() - Writes logging info to a file.
     77 *
     78 * @uses $xmlrpc_logging
     79 * @package WordPress
     80 * @subpackage Logging
     81 *
     82 * @param string $io Whether input or output
     83 * @param string $msg Information describing logging reason.
     84 * @return bool Always return true
     85 */
    5286function logIO($io,$msg) {
    5387    global $xmlrpc_logging;
     
    6397
    6498if ( isset($HTTP_RAW_POST_DATA) )
    65   logIO("I", $HTTP_RAW_POST_DATA);
    66 
     99    logIO("I", $HTTP_RAW_POST_DATA);
     100
     101/**
     102 * @internal
     103 * Left undocumented to work on later. If you want to finish, then please do so.
     104 *
     105 * @package WordPress
     106 * @subpackage Publishing
     107 */
    67108class wp_xmlrpc_server extends IXR_Server {
    68109
Note: See TracChangeset for help on using the changeset viewer.