[WordPress] Including Ajax files in WordPress so the code fires early enough to be used for the rest of the plugin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require dirname( __FILE__ ) . '/inc/sensei-ajax.php'; | |
/** | |
* All Ajax functionality. This is included in a single file | |
* so that the events can be registered earlier in the WordPress lifeycle. | |
* | |
* @since 1.0.0 | |
*/ | |
function sensei_start_ajax() { | |
$ajax = new Sensei_Ajax(); | |
$ajax->init(); | |
} | |
sensei_start_ajax(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once dirname( __FILE__ ) . '/lib/sensei-timed-quizzes/sensei-timed-quizzes.php'; | |
/** | |
* Begins execution of the Timed Quiz plugin. | |
* | |
* Since everything within the plugin is registered via hooks, | |
* then kicking off the plugin from this point in the file does | |
* not affect the page life cycle. | |
* | |
* @since 1.0.0 | |
*/ | |
function sensei_timed_quizzes_start() { | |
$plugin = new Sensei_Timed_Quizzes(); | |
$plugin->run(); | |
} | |
sensei_timed_quizzes_start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment