Title: Load plugin classes from php file
Last modified: September 30, 2018

---

# Load plugin classes from php file

 *  [camelot](https://wordpress.org/support/users/camelot0212/)
 * (@camelot0212)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/load-plugin-classes-from-php-file/)
 * Hello, I tried to load your plugin from another php file it didn’t work.
 * Specifically, I want to make sure this filter run
 *     ```
       <?php $items = $this->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item_id => $item ) : ?>
       <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $this->type, $this->order, $item_id ); ?>">
       ```
   
 * I used require to load all related classes I could find: WPO, Documents, Data,
   WC_Core, Order, Product, Order_Document, Order_Document_Methods, Invoice but 
   it still didn’t work. Please help, I’m not familiar with using namespace. Thank
   you

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/load-plugin-classes-from-php-file/#post-10738283)
 * You can’t use the plugin unless WordPress and WooCommerce are loaded too. And
   if they are, then the plugin is probably loaded as well…. (and if not, then simply
   calling `WPO_WCPDF()` should load everything). Which probably means it’s going
   wrong somewhere else. Could you elaborate a bit on the “I tried to load your 
   plugin from another php file” statement?

Viewing 1 replies (of 1 total)

The topic ‘Load plugin classes from php file’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ewout](https://wordpress.org/support/users/pomegranate/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/load-plugin-classes-from-php-file/#post-10738283)
 * Status: not resolved