Make WordPress Core

Changeset 13527


Ignore:
Timestamp:
03/01/2010 11:49:50 AM (15 years ago)
Author:
dd32
Message:

Add a front end Ajax handler. Props Denis-de-Bernardy. See #12400

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r13483 r13527  
    20162016}
    20172017
     2018/**
     2019 * Prints the ajax url on the front end
     2020 *
     2021 * @since 3.0
     2022 **/
     2023function _wp_ajaxurl() {
     2024    echo '<script type="text/javascript">',
     2025            "var ajaxurl = '", esc_js(site_url('wp-ajax.php')), "';",
     2026        "</script>\n";
     2027}
     2028
     2029/**
     2030 * Hooks _wp_ajaxurl() to wp_head
     2031 *
     2032 * @since 3.0
     2033 **/
     2034function wp_ajaxurl() {
     2035    add_action('wp_head', '_wp_ajaxurl', 1);
     2036}
     2037
    20182038?>
  • trunk/wp-settings.php

    r13507 r13527  
    290290 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
    291291 *
    292  * AJAX requests should use wp-admin/admin-ajax.php.
     292 * AJAX requests should use wp-ajax.php and wp-admin/admin-ajax.php instead.
    293293 *
    294294 * @since 3.0.0
Note: See TracChangeset for help on using the changeset viewer.