Plugin: Refactor to use as foundation for planned pledge workflows (#23)

This starts to address several items in the roadmap, but probably doesn't fully address any of them. It takes the plugin code that was written several months ago, before the scope of this project was fully sorted out, and refactors it to be a starting point for the roadmap.

* Adds template files for form inputs that can be used to both create new pledges and manage existing pledges
* Does some validation and sanitization work on form submissions
* Adds a custom post status for deactivated pledges
This commit is contained in:
Corey McKrill 2019-10-04 12:35:02 -07:00 committed by GitHub
parent 7a355b8314
commit ded645fabc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 613 additions and 323 deletions

View file

@ -23,8 +23,44 @@ add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
*
*/
function load() {
require_once PATH . 'includes/pledge.php';
require_once PATH . 'includes/pledge-meta.php';
require_once PATH . 'includes/pledge-form.php';
require_once PATH . 'includes/shortcodes.php';
require_once get_includes_path() . 'pledge.php';
require_once get_includes_path() . 'pledge-meta.php';
require_once get_includes_path() . 'pledge-form.php';
require_once get_includes_path() . 'shortcodes.php';
}
/**
* Shortcut to the assets directory.
*
* @return string
*/
function get_assets_path() {
return PATH . 'assets/';
}
/**
* Shortcut to the assets URL.
*
* @return string
*/
function get_assets_url() {
return URL . 'assets/';
}
/**
* Shortcut to the includes directory.
*
* @return string
*/
function get_includes_path() {
return PATH . 'includes/';
}
/**
* Shortcut to the views directory.
*
* @return string
*/
function get_views_path() {
return PATH . 'views/';
}