Title: Assign new class to variable
Last modified: July 14, 2017

---

# Assign new class to variable

 *  [Matt Chestnut](https://wordpress.org/support/users/mchestnut/)
 * (@mchestnut)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/assign-new-class-to-variable/)
 * I’d like to recommend assigning your plugin class to a variable. This will allow
   other developers or theme editors to modify your actions.
 * For example, I wanted to change the location that the discount special offer 
   text appears on my single product page. It should be as simple as using remove_action
   to remove your single_product_summary action, then adding it back in at a new
   priority. But since the class is instantiated without being assigned, there’s
   no way to call it.
 * **Simple fix**
    Change line 1042 of woocommerce-bulk-discount.php to: `$woo_bulk_discount_plugin_t4m
   = new Woo_Bulk_Discount_Plugin_t4m();`
 * Otherwise, love the plugin. Thanks!

The topic ‘Assign new class to variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-bulk-discount_83d8ff.
   svg)
 * [WooCommerce Bulk Discount](https://wordpress.org/plugins/woocommerce-bulk-discount/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-bulk-discount/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-bulk-discount/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-bulk-discount/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-bulk-discount/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-bulk-discount/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Matt Chestnut](https://wordpress.org/support/users/mchestnut/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/assign-new-class-to-variable/)
 * Status: not resolved