WordPress.org

Ready to get started?Download WordPress

Ideas

Add AJAX access that doesn't have to be admin-based

  1. Jeremy Massel
    Member

    The wp-admin/admin-ajax.php file is really great for admin-side stuff, but the ability to access WordPress actions without having to be logged in would be really useful.

    Obviously, there would be security concerns, you don't want just anybody being able to run commands, so perhaps make it so that only specified wp_ajax_* actions can be run by this. Would allow for much nicer AJAX functionality in themes.

    Thanks

    Posted: 5 years ago #
  2. Jeremy Massel
    Member

    Basic idea for code, without any consideration for security:

    <?php

    define('DOING_AJAX', true);
    define('WP_ADMIN', true);

    require_once('../wp-load.php');
    require_once('includes/admin.php');

    if ( isset( $_GET['action'] ) ){
    do_action( 'wp_ajax_' . $_GET['action'] );
    die('0');
    }

    ?>

    Posted: 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    0 Votes
  • Status

    This is plugin territory