Make WordPress Core


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

File:
1 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?>
Note: See TracChangeset for help on using the changeset viewer.