/** * Constructor */ public function __construct() { $this->type = 'shop_order'; // Before data updates add_filter('wp_insert_post_data', array($this, 'wp_insert_post_data')); // Admin Columns add_filter('manage_edit-' . $this->type . '_columns', array($this, 'edit_columns')); add_action('manage_' . $this->type . '_posts_custom_column', array($this, 'custom_columns'), 2); // Views and filtering add_filter('views_edit-shop_order', array($this, 'custom_order_views')); add_filter('bulk_actions-edit-shop_order', array($this, 'bulk_actions')); add_filter('post_row_actions', array($this, 'remove_row_actions'), 10, 1); add_action('restrict_manage_posts', array($this, 'restrict_manage_orders')); add_filter('request', array($this, 'orders_by_customer_query')); add_filter("manage_edit-shop_order_sortable_columns", array($this, 'custom_shop_order_sort')); add_filter('request', array($this, 'custom_shop_order_orderby')); add_filter('get_search_query', array($this, 'shop_order_search_label')); add_filter('query_vars', array($this, 'add_custom_query_var')); add_action('parse_query', array($this, 'shop_order_search_custom_fields')); add_action('before_delete_post', array($this, 'delete_order_items')); // Bulk edit add_action('admin_footer', array($this, 'bulk_admin_footer'), 10); add_action('load-edit.php', array($this, 'bulk_action')); add_action('admin_notices', array($this, 'bulk_admin_notices')); // Call WC_Admin_CPT constructor parent::__construct(); }
/** * Constructor */ public function __construct() { $this->type = 'shop_coupon'; // Post title fields add_filter('enter_title_here', array($this, 'enter_title_here'), 1, 2); add_action('edit_form_after_title', array($this, 'coupon_description_field')); // Admin Columns add_filter('manage_edit-shop_coupon_columns', array($this, 'edit_columns')); add_action('manage_shop_coupon_posts_custom_column', array($this, 'custom_columns'), 2); add_filter('request', array($this, 'coupons_by_type_query')); // Product filtering add_action('restrict_manage_posts', array($this, 'coupon_filters')); // Call WC_Admin_CPT constructor parent::__construct(); }
/** * Constructor */ public function __construct() { $this->type = 'product'; // Post title fields add_filter('enter_title_here', array($this, 'enter_title_here'), 1, 2); // Featured image text add_filter('gettext', array($this, 'featured_image_gettext')); add_filter('media_view_strings', array($this, 'media_view_strings'), 10, 2); // Visibility option add_action('post_submitbox_misc_actions', array($this, 'product_data_visibility')); // Before data updates add_action('pre_post_update', array($this, 'pre_post_update')); add_filter('wp_insert_post_data', array($this, 'wp_insert_post_data')); // Admin Columns add_filter('manage_edit-product_columns', array($this, 'edit_columns')); add_action('manage_product_posts_custom_column', array($this, 'custom_columns'), 2); add_filter('manage_edit-product_sortable_columns', array($this, 'custom_columns_sort')); add_filter('request', array($this, 'custom_columns_orderby')); // Sort link add_filter('views_edit-product', array($this, 'default_sorting_link')); // Prouct filtering add_action('restrict_manage_posts', array($this, 'product_filters')); add_filter('parse_query', array($this, 'product_filters_query')); // Enhanced search add_filter('posts_search', array($this, 'product_search')); // Maintain hierarchy of terms add_filter('wp_terms_checklist_args', array($this, 'disable_checked_ontop')); // Bulk / quick edit add_action('bulk_edit_custom_box', array($this, 'bulk_edit'), 10, 2); add_action('quick_edit_custom_box', array($this, 'quick_edit'), 10, 2); add_action('save_post', array($this, 'bulk_and_quick_edit_save_post'), 10, 2); // Uploads add_filter('upload_dir', array($this, 'upload_dir')); add_action('media_upload_downloadable_product', array($this, 'media_upload_downloadable_product')); add_filter('mod_rewrite_rules', array($this, 'ms_protect_download_rewite_rules')); // Download permissions add_action('woocommerce_process_product_file_download_paths', array($this, 'process_product_file_download_paths'), 10, 3); // Call WC_Admin_CPT constructor parent::__construct(); }