WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #21612


Ignore:
Timestamp:
08/16/12 19:17:00 (3 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21612 – Description

    initial v1  
    11When manually initializing WordPress (like in a page that handles AJAX requests) to access all WordPress functions, it is typical to begin the file with: 
    22 
    3 ` 
     3{{{ 
    44        define('WP_USE_THEMES', FALSE); 
    55        require($_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php'); 
    6 ` 
     6}}} 
    77 
    88However, if a plugin calls the `get_userdata()` function, the page will deliver this fatal error: 
    99 
    10 ` 
     10{{{ 
    1111        Fatal error: Call to undefined function get_userdata() in [...]/wp-includes/user.php on line 1402 
    12 ` 
     12}}} 
    1313 
    1414The "Maintenance" plugin is an example of one that causes this issue.