admin_head.php
1 month ago
admin_init.php
1 month ago
admin_menu.php
1 month ago
admin_notices.php
1 month ago
init.php
1 month ago
pmxe_after_export.php
1 month ago
pmxe_before_export.php
1 month ago
pmxe_exported_post.php
1 month ago
wp_ajax_dismiss_export_warnings.php
1 month ago
wp_ajax_dismiss_review_modal.php
1 month ago
wp_ajax_dismiss_warnings.php
1 month ago
wp_ajax_generate_zapier_api_key.php
1 month ago
wp_ajax_redirect_after_addon_installed.php
1 month ago
wp_ajax_save_scheduling.php
1 month ago
wp_ajax_scheduling_dialog_content.php
1 month ago
wp_ajax_scheduling_subscribe_dialog_content.php
1 month ago
wp_ajax_send_feedback.php
1 month ago
wp_ajax_wpae_available_rules.php
1 month ago
wp_ajax_wpae_filtering.php
1 month ago
wp_ajax_wpae_filtering_count.php
1 month ago
wp_ajax_wpae_get_scheduling_connection_icon.php
1 month ago
wp_ajax_wpae_preview.php
1 month ago
wp_ajax_wpae_upgrade_notice.php
1 month ago
wp_ajax_wpallexport.php
1 month ago
wp_loaded.php
1 month ago
wpmu_new_blog.php
1 month ago
wp_ajax_wpae_available_rules.php
121 lines
| 1 | <?php |
| 2 | |
| 3 | defined( 'ABSPATH' ) || exit; |
| 4 | |
| 5 | |
| 6 | function pmxe_wp_ajax_wpae_available_rules(){ |
| 7 | |
| 8 | if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){ |
| 9 | exit( json_encode(array('html' => __('Security check', 'wp-all-export'))) ); |
| 10 | } |
| 11 | |
| 12 | if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){ |
| 13 | exit( json_encode(array('html' => __('Security check', 'wp-all-export'))) ); |
| 14 | } |
| 15 | |
| 16 | ob_start(); |
| 17 | |
| 18 | $input = new PMXE_Input(); |
| 19 | |
| 20 | $post = $input->post('data', array()); |
| 21 | |
| 22 | $is_date = false; |
| 23 | |
| 24 | if(class_exists('GF_Export_Add_On')) { |
| 25 | $gf_addon = \GF_Export_Add_On::get_instance()->add_on; |
| 26 | |
| 27 | $element = $gf_addon->get_data_element_by_slug($post['selected']); |
| 28 | |
| 29 | if (isset($element['filterable']) && $element['filterable'] === 'date') { |
| 30 | $is_date = true; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | ?> |
| 35 | <select id="wp_all_export_rule"> |
| 36 | <option value=""><?php esc_html_e('Select Rule', 'wp-all-export'); ?></option> |
| 37 | <?php |
| 38 | if (strpos($post['selected'], 'tx_') === 0 || strpos($post['selected'], 'product_tx') === 0){ |
| 39 | ?> |
| 40 | |
| 41 | <!-- Taxonomies --> |
| 42 | <option value="in"><?php echo esc_attr(__('In', 'wp-all-export') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected']))); ?></option> |
| 43 | <option value="not_in"><?php echo esc_attr(__('Not In', 'wp-all-export') . ' ' . ucwords(str_replace(array("product_tx", "tx_", "_"), array("", "", " "), $post['selected']))); ?></option> |
| 44 | |
| 45 | <!-- Custom Fields --> |
| 46 | <!--option value="between">BETWEEN</option--> |
| 47 | |
| 48 | <?php |
| 49 | } |
| 50 | elseif( in_array($post['selected'], array('post_date', 'post_modified', 'user_registered', 'comment_date', 'cf__completed_date')) ) |
| 51 | { |
| 52 | ?> |
| 53 | <option value="equals"><?php esc_html_e('equals', 'wp-all-export'); ?></option> |
| 54 | <option value="not_equals"><?php esc_html_e("doesn't equal", 'wp-all-export'); ?></option> |
| 55 | <option value="greater"><?php esc_html_e('newer than', 'wp-all-export');?></option> |
| 56 | <option value="equals_or_greater"><?php esc_html_e('equal to or newer than', 'wp-all-export'); ?></option> |
| 57 | <option value="less"><?php esc_html_e('older than', 'wp-all-export'); ?></option> |
| 58 | <option value="equals_or_less"><?php esc_html_e('equal to or older than', 'wp-all-export'); ?></option> |
| 59 | |
| 60 | <option value="contains"><?php esc_html_e('contains', 'wp-all-export'); ?></option> |
| 61 | <option value="not_contains"><?php esc_html_e("doesn't contain", 'wp-all-export'); ?></option> |
| 62 | <option value="is_empty"><?php esc_html_e('is empty', 'wp-all-export'); ?></option> |
| 63 | <option value="is_not_empty"><?php esc_html_e('is not empty', 'wp-all-export'); ?></option> |
| 64 | <?php |
| 65 | } |
| 66 | elseif( in_array($post['selected'], array('wp_capabilities'))) |
| 67 | { |
| 68 | ?> |
| 69 | <option value="contains"><?php esc_html_e('contains', 'wp-all-export'); ?></option> |
| 70 | <option value="not_contains"><?php esc_html_e("doesn't contain", 'wp-all-export'); ?></option> |
| 71 | <?php |
| 72 | } |
| 73 | elseif ( in_array($post['selected'], array('user_login', 'user_nicename', 'user_role', 'user_email', 'display_name', 'first_name', 'last_name', 'nickname', 'description', |
| 74 | 'post_status', 'post_title', 'post_content', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_agent', |
| 75 | 'comment_type', 'comment_content') ) ) |
| 76 | { |
| 77 | ?> |
| 78 | <option value="equals"><?php esc_html_e('equals', 'wp-all-export'); ?></option> |
| 79 | <option value="not_equals"><?php esc_html_e("doesn't equal", 'wp-all-export'); ?></option> |
| 80 | <option value="contains"><?php esc_html_e('contains', 'wp-all-export'); ?></option> |
| 81 | <option value="not_contains"><?php esc_html_e("doesn't contain", 'wp-all-export'); ?></option> |
| 82 | <option value="is_empty"><?php esc_html_e('is empty', 'wp-all-export'); ?></option> |
| 83 | <option value="is_not_empty"><?php esc_html_e('is not empty', 'wp-all-export'); ?></option> |
| 84 | <?php |
| 85 | } |
| 86 | elseif ( in_array($post['selected'], array('term_parent_slug') ) ) |
| 87 | { |
| 88 | ?> |
| 89 | <option value="equals"><?php esc_html_e('equals', 'wp-all-export'); ?></option> |
| 90 | <option value="not_equals"><?php esc_html_e("doesn't equal", 'wp-all-export'); ?></option> |
| 91 | <option value="greater"><?php esc_html_e('greater than', 'wp-all-export');?></option> |
| 92 | <option value="equals_or_greater"><?php esc_html_e('equal to or greater than', 'wp-all-export'); ?></option> |
| 93 | <option value="less"><?php esc_html_e('less than', 'wp-all-export'); ?></option> |
| 94 | <option value="equals_or_less"><?php esc_html_e('equal to or less than', 'wp-all-export'); ?></option> |
| 95 | <option value="is_empty"><?php esc_html_e('is empty', 'wp-all-export'); ?></option> |
| 96 | <option value="is_not_empty"><?php esc_html_e('is not empty', 'wp-all-export'); ?></option> |
| 97 | <?php |
| 98 | } |
| 99 | else |
| 100 | { |
| 101 | ?> |
| 102 | <option value="equals"><?php esc_html_e('equals', 'wp-all-export'); ?></option> |
| 103 | <option value="not_equals"><?php esc_html_e("doesn't equal", 'wp-all-export'); ?></option> |
| 104 | <option value="greater"><?php esc_html_e('greater than', 'wp-all-export');?></option> |
| 105 | <option value="equals_or_greater"><?php esc_html_e('equal to or greater than', 'wp-all-export'); ?></option> |
| 106 | <option value="less"><?php esc_html_e('less than', 'wp-all-export'); ?></option> |
| 107 | <option value="equals_or_less"><?php esc_html_e('equal to or less than', 'wp-all-export'); ?></option> |
| 108 | |
| 109 | <option value="contains"><?php esc_html_e('contains', 'wp-all-export'); ?></option> |
| 110 | <option value="not_contains"><?php esc_html_e("doesn't contain", 'wp-all-export'); ?></option> |
| 111 | <option value="is_empty"><?php esc_html_e('is empty', 'wp-all-export'); ?></option> |
| 112 | <option value="is_not_empty"><?php esc_html_e('is not empty', 'wp-all-export'); ?></option> |
| 113 | <?php |
| 114 | } |
| 115 | ?> |
| 116 | </select> |
| 117 | <?php |
| 118 | |
| 119 | exit(json_encode(array('html' => ob_get_clean()))); die; |
| 120 | |
| 121 | } |