本文整理匯總了PHP中GFExport::maybe_export方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFExport::maybe_export方法的具體用法?PHP GFExport::maybe_export怎麽用?PHP GFExport::maybe_export使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GFExport
的用法示例。
在下文中一共展示了GFExport::maybe_export方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public static function init()
{
load_plugin_textdomain('gravityforms', false, '/gravityforms/languages');
if (IS_ADMIN) {
global $current_user;
//Members plugin integration. Adding Gravity Forms roles to the checkbox list
if (function_exists('members_get_capabilities')) {
add_filter('members_get_capabilities', array("RGForms", "members_get_capabilities"));
//Removing default GF capability when integrating with Members
if (current_user_can("gform_full_access")) {
$current_user->remove_cap("gform_full_access");
}
//If and administrator does not have any Gravity Form permission, add all of them. (will happen the first time Gravity Forms gets installed)
self::initialize_permissions();
} else {
$gform_full_access = current_user_can("administrator") ? "gform_full_access" : "";
$gform_full_access = apply_filters("gform_cap_full_access", $gform_full_access);
if (!empty($gform_full_access)) {
$current_user->add_cap($gform_full_access);
}
}
//Loading Gravity Forms if user has access to any functionality
if (GFCommon::current_user_can_any(GFCommon::all_caps())) {
require_once GFCommon::get_base_path() . "/export.php";
GFExport::maybe_export();
//runs the setup when version changes
self::setup();
//creates the "Forms" left menu
add_action('admin_menu', array('RGForms', 'create_menu'));
if (GF_SUPPORTED_WP_VERSION) {
add_action('admin_footer', array('RGForms', 'check_upload_folder'));
add_action('wp_dashboard_setup', array('RGForms', 'dashboard_setup'));
//Adding "embed form" button
add_action('media_buttons_context', array('RGForms', 'add_form_button'));
//Plugin update actions
add_filter("transient_update_plugins", array('RGForms', 'check_update'));
add_filter("site_transient_update_plugins", array('RGForms', 'check_update'));
if (in_array(RG_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
add_action('admin_footer', array('RGForms', 'add_mce_popup'));
} else {
if (self::is_gravity_page()) {
require_once GFCommon::get_base_path() . "/tooltips.php";
add_action("admin_print_scripts", array('RGForms', 'print_scripts'));
} else {
if (RG_CURRENT_PAGE == 'media-upload.php') {
require_once GFCommon::get_base_path() . "/entry_list.php";
} else {
if (in_array(RG_CURRENT_PAGE, array("admin.php", "admin-ajax.php"))) {
add_action('wp_ajax_rg_save_form', array('RGForms', 'save_form'));
add_action('wp_ajax_rg_change_input_type', array('RGForms', 'change_input_type'));
add_action('wp_ajax_rg_add_field', array('RGForms', 'add_field'));
add_action('wp_ajax_rg_duplicate_field', array('RGForms', 'duplicate_field'));
add_action('wp_ajax_rg_delete_field', array('RGForms', 'delete_field'));
add_action('wp_ajax_rg_delete_file', array('RGForms', 'delete_file'));
add_action('wp_ajax_rg_select_export_form', array('RGForms', 'select_export_form'));
add_action('wp_ajax_rg_start_export', array('RGForms', 'start_export'));
add_action('wp_ajax_gf_upgrade_license', array('RGForms', 'upgrade_license'));
add_action('wp_ajax_gf_delete_custom_choice', array('RGForms', 'delete_custom_choice'));
add_action('wp_ajax_gf_save_custom_choice', array('RGForms', 'save_custom_choice'));
//entry list ajax operations
add_action('wp_ajax_rg_update_lead_property', array('RGForms', 'update_lead_property'));
add_action('wp_ajax_delete-gf_entry', array('RGForms', 'update_lead_status'));
//form list ajax operations
add_action('wp_ajax_rg_update_form_active', array('RGForms', 'update_form_active'));
//dynamic captcha image
add_action('wp_ajax_rg_captcha_image', array('RGForms', 'captcha_image'));
//dashboard message "dismiss upgrade" link
add_action("wp_ajax_rg_dismiss_upgrade", array('RGForms', 'dashboard_dismiss_upgrade'));
// entry detial: resend notifications
add_action("wp_ajax_gf_resend_notifications", array('RGForms', 'resend_notifications'));
}
}
}
}
add_filter("plugins_api", array("RGForms", "get_addon_info"), 10, 3);
add_action('after_plugin_row_gravityforms/gravityforms.php', array('RGForms', 'plugin_row'));
add_action('install_plugins_pre_plugin-information', array('RGForms', 'display_changelog'));
add_filter('plugin_action_links', array('RGForms', 'plugin_settings_link'), 10, 2);
}
}
} else {
add_action('wp_enqueue_scripts', array('RGForms', 'enqueue_scripts'));
add_action('wp', array('RGForms', 'ajax_parse_request'), 10);
}
add_shortcode('gravityform', array('RGForms', 'parse_shortcode'));
}
示例2: init
public static function init()
{
//load text domains
GFCommon::load_gf_text_domain('gravityforms');
add_filter('gform_logging_supported', array('RGForms', 'set_logging_supported'));
add_action('admin_head', array('GFCommon', 'maybe_output_gf_vars'));
self::register_scripts();
//Maybe set up Gravity Forms: only on admin requests for single site installation and always for multisite
if (IS_ADMIN && false === (defined('DOING_AJAX') && true === DOING_AJAX) || is_multisite()) {
self::setup();
}
//Plugin update actions
add_filter('transient_update_plugins', array('GFForms', 'check_update'));
add_filter('site_transient_update_plugins', array('GFForms', 'check_update'));
add_filter('auto_update_plugin', array('GFForms', 'maybe_auto_update'), 10, 2);
if (IS_ADMIN) {
global $current_user;
//Members plugin integration. Adding Gravity Forms roles to the checkbox list
if (self::has_members_plugin()) {
add_filter('members_get_capabilities', array('RGForms', 'members_get_capabilities'));
}
if (is_multisite()) {
add_filter('wpmu_drop_tables', array('GFFormsModel', 'mu_drop_tables'));
}
add_action('admin_enqueue_scripts', array('GFForms', 'enqueue_admin_scripts'));
add_action('print_media_templates', array('GFForms', 'action_print_media_templates'));
if (defined('WP_DEBUG') && WP_DEBUG) {
add_action('admin_footer', array('GFForms', 'deprecate_add_on_methods'));
}
//Loading Gravity Forms if user has access to any functionality
if (GFCommon::current_user_can_any(GFCommon::all_caps())) {
require_once GFCommon::get_base_path() . '/export.php';
GFExport::maybe_export();
//imports theme forms if configured to be automatic imported
self::maybe_import_theme_forms();
//creates the "Forms" left menu
add_action('admin_menu', array('RGForms', 'create_menu'));
if (GF_SUPPORTED_WP_VERSION) {
add_action('admin_footer', array('RGForms', 'check_upload_folder'));
add_action('wp_dashboard_setup', array('RGForms', 'dashboard_setup'));
// Support modifying the admin page title for settings
add_filter('admin_title', array(__CLASS__, 'modify_admin_title'), 10, 2);
//Adding "embed form" button
add_action('media_buttons', array('RGForms', 'add_form_button'), 20);
require_once GFCommon::get_base_path() . '/includes/locking/locking.php';
if (self::page_supports_add_form_button()) {
add_action('admin_footer', array('RGForms', 'add_mce_popup'));
}
if (self::is_gravity_page()) {
require_once GFCommon::get_base_path() . '/tooltips.php';
} else {
if (RG_CURRENT_PAGE == 'media-upload.php') {
require_once GFCommon::get_base_path() . '/entry_list.php';
} else {
if (in_array(RG_CURRENT_PAGE, array('admin.php', 'admin-ajax.php'))) {
add_action('wp_ajax_rg_save_form', array('RGForms', 'save_form'));
add_action('wp_ajax_rg_change_input_type', array('RGForms', 'change_input_type'));
add_action('wp_ajax_rg_refresh_field_preview', array('RGForms', 'refresh_field_preview'));
add_action('wp_ajax_rg_add_field', array('RGForms', 'add_field'));
add_action('wp_ajax_rg_duplicate_field', array('RGForms', 'duplicate_field'));
add_action('wp_ajax_rg_delete_field', array('RGForms', 'delete_field'));
add_action('wp_ajax_rg_delete_file', array('RGForms', 'delete_file'));
add_action('wp_ajax_rg_select_export_form', array('RGForms', 'select_export_form'));
add_action('wp_ajax_rg_start_export', array('RGForms', 'start_export'));
add_action('wp_ajax_gf_upgrade_license', array('RGForms', 'upgrade_license'));
add_action('wp_ajax_gf_delete_custom_choice', array('RGForms', 'delete_custom_choice'));
add_action('wp_ajax_gf_save_custom_choice', array('RGForms', 'save_custom_choice'));
add_action('wp_ajax_gf_get_post_categories', array('RGForms', 'get_post_category_values'));
add_action('wp_ajax_gf_get_notification_post_categories', array('RGForms', 'get_notification_post_category_values'));
add_action('wp_ajax_gf_save_confirmation', array('RGForms', 'save_confirmation'));
add_action('wp_ajax_gf_delete_confirmation', array('RGForms', 'delete_confirmation'));
add_action('wp_ajax_gf_save_new_form', array('RGForms', 'save_new_form'));
//entry list ajax operations
add_action('wp_ajax_rg_update_lead_property', array('RGForms', 'update_lead_property'));
add_action('wp_ajax_delete-gf_entry', array('RGForms', 'update_lead_status'));
//form list ajax operations
add_action('wp_ajax_rg_update_form_active', array('RGForms', 'update_form_active'));
//notification list ajax operations
add_action('wp_ajax_rg_update_notification_active', array('RGForms', 'update_notification_active'));
//confirmation list ajax operations
add_action('wp_ajax_rg_update_confirmation_active', array('RGForms', 'update_confirmation_active'));
//dynamic captcha image
add_action('wp_ajax_rg_captcha_image', array('RGForms', 'captcha_image'));
//dashboard message "dismiss upgrade" link
add_action('wp_ajax_rg_dismiss_upgrade', array('RGForms', 'dashboard_dismiss_upgrade'));
// entry detail: resend notifications
add_action('wp_ajax_gf_resend_notifications', array('RGForms', 'resend_notifications'));
// Shortcode UI
add_action('wp_ajax_gf_do_shortcode', array('GFForms', 'handle_ajax_do_shortcode'));
}
}
}
add_filter('plugins_api', array('RGForms', 'get_addon_info'), 100, 3);
add_action('after_plugin_row_gravityforms/gravityforms.php', array('RGForms', 'plugin_row'));
add_action('install_plugins_pre_plugin-information', array('RGForms', 'display_changelog'));
add_filter('plugin_action_links', array('RGForms', 'plugin_settings_link'), 10, 2);
}
}
add_action('admin_init', array('RGForms', 'ajax_parse_request'), 10);
} else {
//.........這裏部分代碼省略.........
示例3: init
public static function init()
{
add_filter("gform_logging_supported", array("RGForms", "set_logging_supported"));
if (IS_ADMIN) {
global $current_user;
//Members plugin integration. Adding Gravity Forms roles to the checkbox list
if (self::has_members_plugin()) {
add_filter('members_get_capabilities', array("RGForms", "members_get_capabilities"));
}
//Loading Gravity Forms if user has access to any functionality
if (GFCommon::current_user_can_any(GFCommon::all_caps())) {
require_once GFCommon::get_base_path() . "/export.php";
GFExport::maybe_export();
//runs the setup when version changes
self::setup();
//creates the "Forms" left menu
add_action('admin_menu', array('RGForms', 'create_menu'));
if (GF_SUPPORTED_WP_VERSION) {
add_action('admin_footer', array('RGForms', 'check_upload_folder'));
add_action('wp_dashboard_setup', array('RGForms', 'dashboard_setup'));
//Adding "embed form" button
add_action('media_buttons', array('RGForms', 'add_form_button'), 20);
//Plugin update actions
add_filter("transient_update_plugins", array('RGForms', 'check_update'));
add_filter("site_transient_update_plugins", array('RGForms', 'check_update'));
if (in_array(RG_CURRENT_PAGE, array('post.php', 'page.php', 'page-new.php', 'post-new.php'))) {
add_action('admin_footer', array('RGForms', 'add_mce_popup'));
} else {
if (self::is_gravity_page()) {
require_once GFCommon::get_base_path() . "/tooltips.php";
add_action("admin_print_scripts", array('RGForms', 'print_scripts'));
} else {
if (RG_CURRENT_PAGE == 'media-upload.php') {
require_once GFCommon::get_base_path() . "/entry_list.php";
} else {
if (in_array(RG_CURRENT_PAGE, array("admin.php", "admin-ajax.php"))) {
add_action('wp_ajax_rg_save_form', array('RGForms', 'save_form'));
add_action('wp_ajax_rg_change_input_type', array('RGForms', 'change_input_type'));
add_action('wp_ajax_rg_add_field', array('RGForms', 'add_field'));
add_action('wp_ajax_rg_duplicate_field', array('RGForms', 'duplicate_field'));
add_action('wp_ajax_rg_delete_field', array('RGForms', 'delete_field'));
add_action('wp_ajax_rg_delete_file', array('RGForms', 'delete_file'));
add_action('wp_ajax_rg_select_export_form', array('RGForms', 'select_export_form'));
add_action('wp_ajax_rg_start_export', array('RGForms', 'start_export'));
add_action('wp_ajax_gf_upgrade_license', array('RGForms', 'upgrade_license'));
add_action('wp_ajax_gf_delete_custom_choice', array('RGForms', 'delete_custom_choice'));
add_action('wp_ajax_gf_save_custom_choice', array('RGForms', 'save_custom_choice'));
add_action('wp_ajax_gf_get_post_categories', array('RGForms', 'get_post_category_values'));
add_action('wp_ajax_gf_get_notification_post_categories', array('RGForms', 'get_notification_post_category_values'));
//entry list ajax operations
add_action('wp_ajax_rg_update_lead_property', array('RGForms', 'update_lead_property'));
add_action('wp_ajax_delete-gf_entry', array('RGForms', 'update_lead_status'));
//form list ajax operations
add_action('wp_ajax_rg_update_form_active', array('RGForms', 'update_form_active'));
//dynamic captcha image
add_action('wp_ajax_rg_captcha_image', array('RGForms', 'captcha_image'));
//dashboard message "dismiss upgrade" link
add_action("wp_ajax_rg_dismiss_upgrade", array('RGForms', 'dashboard_dismiss_upgrade'));
// entry detial: resend notifications
add_action("wp_ajax_gf_resend_notifications", array('RGForms', 'resend_notifications'));
}
}
}
}
add_filter("plugins_api", array("RGForms", "get_addon_info"), 10, 3);
add_action('after_plugin_row_gravityforms/gravityforms.php', array('RGForms', 'plugin_row'));
add_action('install_plugins_pre_plugin-information', array('RGForms', 'display_changelog'));
add_filter('plugin_action_links', array('RGForms', 'plugin_settings_link'), 10, 2);
}
}
} else {
add_action('wp_enqueue_scripts', array('RGForms', 'enqueue_scripts'));
add_action('wp', array('RGForms', 'ajax_parse_request'), 10);
// ManageWP premium update filters
add_filter('mwp_premium_update_notification', array('RGForms', 'premium_update_push'));
add_filter('mwp_premium_perform_update', array('RGForms', 'premium_update'));
}
add_shortcode('gravityform', array('RGForms', 'parse_shortcode'));
add_shortcode('gravityforms', array('RGForms', 'parse_shortcode'));
}