woocommerce/includes/admin
Luciano Amodio 865efa3736 Add product export row action hook
having this hook is possible to actually use the woocommerce_product_export_product_query_args filter

```
add_action('woocommerce_product_export_row', 'export_custom_product');
add_filter( 'woocommerce_product_export_product_query_args', 'export_product_query_args');

// https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query
add_filter( 'woocommerce_product_data_store_cpt_get_products_query', 'handle_custom_query_var', 10, 2 );

function export_custom_product() {
  $args = [
    'show_option_all' =>  'Custom',
    'taxonomy'        =>  'pa_custom',
    'name'            =>  'custom',
    'orderby'         =>  'name',
    'order'           => 'ASC',
    'selected'        =>  isset($_REQUEST['custom']) ? $_REQUEST['custom'] : '',
    'show_count'      =>  true,
    'hide_empty'      =>  true,
    'menu_order'      => false
  ];
  ?>
  <tr>
    <th scope="row">
      <label for="custom">Filter by Custom</label>
    </th>
    <td>
      <?php wp_dropdown_categories($args); ?>
    </td>
  </tr>
  <?php
}

function export_product_query_args($args) {
  $args['custom'] = 'default';

  if ( ! empty( $_POST['form'] ) ) {
    $values = explode('=', $_POST['form']);
    if('custom' === $values[0]) {
      $args['custom'] = wp_unslash( $values[1] );
    }
  }

  return $args;
}

function handle_custom_query_var( $query, $query_vars ) {
  if ( ! empty( $query_vars['custom'] ) ) {
    $query['tax_query'][] = array(
      'taxonomy' => 'pa_ custom',
      'field' => 'id',
      'terms' => esc_attr( $query_vars['custom'] )
    );
  }

  return $query;
}
```
2017-12-20 20:13:10 +01:00
..
helper Helper: Prompt connection to WooCommerce.com for updates/support 2017-12-13 19:34:44 +03:00
importers Update wording for #17968 2017-12-05 13:31:42 +00:00
list-tables [WC 3.3] Fix fatal if gateway is deactivated 2017-12-13 13:59:07 -05:00
meta-boxes Merge pull request #18162 from WPprodigy/downloads-logging-enhancements 2017-12-15 11:09:21 +00:00
plugin-updates Moved major update check into get_untested_plugins. 2017-10-17 08:27:55 -07:00
reports Escaping 2017-12-15 04:26:22 -06:00
settings Remove useless translators comment 2017-12-12 20:49:10 +01:00
views Add product export row action hook 2017-12-20 20:13:10 +01:00
class-wc-admin-addons.php Merge Commit 2017-12-07 12:10:00 -05:00
class-wc-admin-api-keys-table-list.php Fixed "singular" and "plural" parameters of WP_List_Table instances 2017-04-05 18:15:40 -03:00
class-wc-admin-api-keys.php Add icons and fix links 2017-04-27 12:23:16 +01:00
class-wc-admin-assets.php Add button for copying DL link 2017-12-13 23:57:47 -06:00
class-wc-admin-attributes.php Update text. 2017-12-11 13:19:19 +00:00
class-wc-admin-customize.php Missing comma for code standards 2017-04-19 11:15:10 +01:00
class-wc-admin-dashboard.php Merge pull request #15515 from woocommerce/update/15399 2017-06-08 15:53:00 -03:00
class-wc-admin-duplicate-product.php Use global if it exists to improve performance. 2017-11-01 12:43:26 +00:00
class-wc-admin-exporters.php phpcs 2017-12-07 12:35:13 +00:00
class-wc-admin-help.php Load videos when the help tab is opened, not before. 2017-10-12 12:18:37 +01:00
class-wc-admin-importers.php Apply attribute helper functions to importers and REST API 2017-08-07 22:34:25 -03:00
class-wc-admin-log-table-list.php wp_unslash() needs to always comes first 2017-11-06 19:10:33 +01:00
class-wc-admin-menus.php Merge branch 'master' into feature/webhook-crud 2017-11-16 12:20:22 -02:00
class-wc-admin-meta-boxes.php fixes woocommerce/woocommerce#15896 2017-06-30 21:20:23 +02:00
class-wc-admin-notices.php Remove need for wc_get_core_supported_themes 2017-11-07 12:17:03 +00:00
class-wc-admin-permalink-settings.php phpcs 2017-12-05 14:02:40 +00:00
class-wc-admin-pointers.php Typo in tag text, fixes #16332 2017-08-03 08:19:57 +02:00
class-wc-admin-post-types.php Hooks for columns and preview list tables 2017-11-21 16:22:43 +00:00
class-wc-admin-profile.php Assign type='button' to 'Copy from billing address' 2017-11-16 14:46:05 +01:00
class-wc-admin-reports.php More filter options 2017-11-13 19:03:08 +00:00
class-wc-admin-settings.php Convert allowed options to string values for comparison, html options have no data type distiction. 2017-12-15 13:39:05 +02:00
class-wc-admin-setup-wizard.php Change WC::is_active_theme into a global function wc_is_active_theme. Clean up the conditional checks to read better. 2017-12-15 14:32:54 +02:00
class-wc-admin-status.php Fix - Bulk action in status logs table, Closes #17919 2017-11-29 14:49:49 +05:45
class-wc-admin-taxonomies.php Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
class-wc-admin-webhooks-table-list.php Fixed webhook pagination results 2017-11-28 15:27:31 -02:00
class-wc-admin-webhooks.php Removed legacy custom topic handler 2017-12-07 18:04:45 -02:00
class-wc-admin.php Fix duplicate plugin install from wizard. (#17114) 2017-10-09 16:45:33 -06:00
wc-admin-functions.php Mobile styling 2017-11-22 16:28:11 +00:00
wc-meta-box-functions.php Dynamic add 2 attribute. 2017-01-02 18:01:52 +05:30