本文整理汇总了PHP中Ninja_Forms::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Ninja_Forms::url方法的具体用法?PHP Ninja_Forms::url怎么用?PHP Ninja_Forms::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ninja_Forms
的用法示例。
在下文中一共展示了Ninja_Forms::url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* Main Ninja_Forms Instance
*
* Insures that only one instance of Ninja_Forms exists in memory at any one
* time. Also prevents needing to define globals all over the place.
*
* @since 2.7
* @static
* @staticvar array $instance
* @return Ninja_Forms Highlander Instance
*/
public static function instance()
{
if (!isset(self::$instance) && !self::$instance instanceof Ninja_Forms) {
self::$instance = new Ninja_Forms();
self::$dir = plugin_dir_path(__FILE__);
if (!defined('NF_PLUGIN_DIR')) {
define('NF_PLUGIN_DIR', self::$dir);
}
self::$url = plugin_dir_url(__FILE__);
if (!defined('NF_PLUGIN_URL')) {
define('NF_PLUGIN_URL', self::$url);
}
update_option('ninja_forms_version', self::VERSION);
/*
* Register our autoloader
*/
spl_autoload_register(array(self::$instance, 'autoloader'));
/*
* Admin Menus
*/
self::$instance->menus['forms'] = new NF_Admin_Menus_Forms();
self::$instance->menus['all-forms'] = new NF_Admin_Menus_AllForms();
self::$instance->menus['add-new'] = new NF_Admin_Menus_AddNew();
self::$instance->menus['settings'] = new NF_Admin_Menus_Settings();
self::$instance->menus['add-ons'] = new NF_Admin_Menus_Addons();
self::$instance->menus['system_status'] = new NF_Admin_Menus_SystemStatus();
self::$instance->menus['submissions'] = new NF_Admin_Menus_Submissions();
self::$instance->menus['import-export'] = new NF_Admin_Menus_ImportExport();
self::$instance->menus['licenses'] = new NF_Admin_Menus_Licenses();
/*
* Admin menus used for building out the admin UI
*
* TODO: removed once building is complete
*/
// self::$instance->menus[ 'add-field'] = new NF_Admin_Menus_AddField();
// self::$instance->menus[ 'edit-field'] = new NF_Admin_Menus_EditField();
// self::$instance->menus[ 'add-action'] = new NF_Admin_Menus_AddAction();
// self::$instance->menus[ 'edit-action'] = new NF_Admin_Menus_EditAction();
// self::$instance->menus[ 'edit-settings'] = new NF_Admin_Menus_EditSettings();
// self::$instance->menus[ 'fields-layout'] = new NF_Admin_Menus_FieldsLayout();
self::$instance->menus['mock-data'] = new NF_Admin_Menus_MockData();
// self::$instance->menus[ 'preview'] = new NF_Admin_Menus_Preview();
/*
* AJAX Controllers
*/
self::$instance->controllers['form'] = new NF_AJAX_Controllers_Form();
self::$instance->controllers['preview'] = new NF_AJAX_Controllers_Preview();
self::$instance->controllers['uploads'] = new NF_AJAX_Controllers_Uploads();
self::$instance->controllers['submission'] = new NF_AJAX_Controllers_Submission();
self::$instance->controllers['savedfields'] = new NF_AJAX_Controllers_SavedFields();
/*
* WP-CLI Commands
*/
if (class_exists('WP_CLI_Command')) {
WP_CLI::add_command('ninja-forms', 'NF_WPCLI_NinjaFormsCommand');
}
/*
* Preview Page
*/
self::$instance->preview = new NF_Display_Preview();
/*
* Shortcodes
*/
self::$instance->shortcodes = new NF_Display_Shortcodes();
/*
* Temporary Shortcodes
*
* TODO: removed once building is complete
*/
require_once self::$dir . 'includes/Display/Shortcodes/tmp-frontend.php';
require_once self::$dir . 'includes/Display/Shortcodes/tmp-preview.php';
require_once self::$dir . 'includes/Display/Shortcodes/tmp-frontendform.php';
require_once self::$dir . 'includes/Display/Shortcodes/tmp-file-upload.php';
/*
* Submission CPT
*/
new NF_Admin_CPT_Submission();
/*
* Logger
*/
self::$instance->_logger = new NF_Database_Logger();
/*
* Merge Tags
*/
self::$instance->merge_tags['user'] = new NF_MergeTags_User();
self::$instance->merge_tags['post'] = new NF_MergeTags_Post();
self::$instance->merge_tags['system'] = new NF_MergeTags_System();
self::$instance->merge_tags['fields'] = new NF_MergeTags_Fields();
self::$instance->merge_tags['calcs'] = new NF_MergeTags_Calcs();
//.........这里部分代码省略.........
示例2: instance
/**
* Main Ninja_Forms Instance
*
* Insures that only one instance of Ninja_Forms exists in memory at any one
* time. Also prevents needing to define globals all over the place.
*
* @since 2.7
* @static
* @staticvar array $instance
* @return Ninja_Forms Highlander Instance
*/
public static function instance()
{
if (!isset(self::$instance) && !self::$instance instanceof Ninja_Forms) {
self::$instance = new Ninja_Forms();
self::$dir = plugin_dir_path(__FILE__);
// Define old constants for backwards compatibility.
if (!defined('NF_PLUGIN_DIR')) {
define('NF_PLUGIN_DIR', self::$dir);
define('NINJA_FORMS_DIR', self::$dir . 'deprecated');
}
self::$url = plugin_dir_url(__FILE__);
if (!defined('NF_PLUGIN_URL')) {
define('NF_PLUGIN_URL', self::$url);
}
update_option('ninja_forms_version', self::VERSION);
/*
* Register our autoloader
*/
spl_autoload_register(array(self::$instance, 'autoloader'));
/*
* Admin Menus
*/
self::$instance->menus['forms'] = new NF_Admin_Menus_Forms();
self::$instance->menus['all-forms'] = new NF_Admin_Menus_AllForms();
self::$instance->menus['add-new'] = new NF_Admin_Menus_AddNew();
self::$instance->menus['submissions'] = new NF_Admin_Menus_Submissions();
self::$instance->menus['import-export'] = new NF_Admin_Menus_ImportExport();
self::$instance->menus['settings'] = new NF_Admin_Menus_Settings();
self::$instance->menus['licenses'] = new NF_Admin_Menus_Licenses();
self::$instance->menus['system_status'] = new NF_Admin_Menus_SystemStatus();
self::$instance->menus['add-ons'] = new NF_Admin_Menus_Addons();
self::$instance->menus['divider'] = new NF_Admin_Menus_Divider();
self::$instance->menus['mock-data'] = new NF_Admin_Menus_MockData();
/*
* AJAX Controllers
*/
self::$instance->controllers['form'] = new NF_AJAX_Controllers_Form();
self::$instance->controllers['preview'] = new NF_AJAX_Controllers_Preview();
self::$instance->controllers['submission'] = new NF_AJAX_Controllers_Submission();
self::$instance->controllers['savedfields'] = new NF_AJAX_Controllers_SavedFields();
/*
* Async Requests
*/
require_once Ninja_Forms::$dir . 'includes/Libraries/BackgroundProcessing/classes/wp-async-request.php';
self::$instance->requests['delete-field'] = new NF_AJAX_Requests_DeleteField();
/*
* WP-CLI Commands
*/
if (class_exists('WP_CLI_Command')) {
WP_CLI::add_command('ninja-forms', 'NF_WPCLI_NinjaFormsCommand');
}
/*
* Preview Page
*/
self::$instance->preview = new NF_Display_Preview();
/*
* Shortcodes
*/
self::$instance->shortcodes = new NF_Display_Shortcodes();
/*
* Submission CPT
*/
new NF_Admin_CPT_Submission();
new NF_Admin_CPT_DownloadAllSubmissions();
require_once Ninja_Forms::$dir . 'lib/StepProcessing/menu.php';
/*
* Logger
*/
self::$instance->_logger = new NF_Database_Logger();
/*
* Merge Tags
*/
self::$instance->merge_tags['user'] = new NF_MergeTags_User();
self::$instance->merge_tags['post'] = new NF_MergeTags_Post();
self::$instance->merge_tags['system'] = new NF_MergeTags_System();
self::$instance->merge_tags['fields'] = new NF_MergeTags_Fields();
self::$instance->merge_tags['calcs'] = new NF_MergeTags_Calcs();
self::$instance->merge_tags['querystrings'] = new NF_MergeTags_QueryStrings();
self::$instance->merge_tags['form'] = new NF_MergeTags_Form();
/*
* Add Form Modal
*/
self::$instance->add_form_modal = new NF_Admin_AddFormModal();
/*
* EOS Parser
*/
self::$instance->_eos['parser'] = (require_once 'includes/Libraries/EOS/Parser.php');
self::$instance->session = new NF_Session();
/*
//.........这里部分代码省略.........