Composer Autoloader as suggested in the comments is the best way to do it. Just use composers classmap feature:
"autoload": {
"classmap": ["classes/"]
}
Related Posts:
- Authenticating to WordPress, using my own authentication two-factor system
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- PHP can I add line numbers to file_get_contents()
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Hook called before text widget save
- Custom Registration username_exists / email_exists
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- How to identify which php file a plugin is using on page load?
- WP Custom tables query
- WordPress and event-driven programming – what is it about?
- WordPress URL Rewrite not working
- Namespacing WordPress project according to FIG standards
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- Limit the Excerpt field in WP-Admin in words
- Does wordpress allow me to add a php file to the root directory to execute custom scripts?
- Saving metabox repeatable fields
- how to create and show sessions in word press?
- do not show web page section when using advanced custom fields pro
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Random Default Avatar Function
- Customizer: Output default value in Customizer CSS
- Taxonomy linked to pages
- WordPress Scheduled Event Request Blocking
- Converting HTML Template to WordPress Theme
- Correct folder permissions?
- Can I install/embed WordPress on a ‘single page’?
- Saving an array of dynamic repeater data as post_meta
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- Improve page speed loading using CDN and async or defer attribute
- Script to browser problem PHP
- Store a default value for a transient on plugin activation
- subdirectory index.php is not working
- wp query foreach deleting record returning only first or last item
- PHP > Scheduled Tasks > Sending daily email with dynamic API variables
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Custom posts in different columns style
- WordPress Custom field Colors
- “Undefined index” error when saving empty array with checkboxes
- Is it save to use eval for a jQuery callback method coming from the database?
- Add data-id attribute to child page links
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Display Youtube Time Automate from Key
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Scheduling an event inside plugin class is not working
- How to Change CSS Colors from Custom Plugin Settings Page
- Passing the name of selected color from the custom component to `render_callback`
- Where is the PHP code generating an element?
- Basic wpdb update question
- wordpress frontend editor to add extra css to website
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- How do i wrap woocomerce attribute in list?
- Calling a save function from a “submit” button
- save metabox with new values _wp_page_template
- pagination broken – clicking next displays “page not found”
- PHP: How to access db the right way in plugin?
- select a single val though a table in wordpress
- Create condition for Author bio Social Links
- WordPress – Get Posts with Category data
- How to use wp_send_json() and output the value with ajax?
- Call to “admin_notices” hook from a static method
- How to Create custom block for displaying information in content section which act like shortcode
- How to detect and handle the time difference between server and user in WordPress?
- How to setup the Email piping in WordPress plugin?
- Getting an error when my plugin is updated, but the files update correctly
- Creating a POP Alert
- If Statement is Ignored?
- WordPress Plugin Development – get_option error
- how to add new PHP page in WordPress plugin
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- Constant expression contains invalid operations plugin class properties visibility
- Search only for posts with specific metadata?
- not able to access $_POST on backend profile update
- Custom Plugin Develoment, Form Action
- WordPress Query Crashes Browser
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- Plugin Modification Change Functionality For Logged User Only
- Is there a way to have chunks of a page’s content expire?
- Where can I find the declaration of `$_wp_theme_features`?
- Static home page ignored
- How do I routinely extract the thumbnail of the most recent post?
- Showing the project type in HREF
- INCOMING: Wall of code for form and $_POST, not updating custom field’s value
- add shortcode heading showing multiple time
- Display tab title as ‘blog tagline | blog title’
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Showing custom field contents without listing description
- Check if values exists DB
- WP multisite network plugin fails to see classes loaded with spl autoload
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- What is this mark for “? function()” [closed]
- What can I do to customize a widget provided with this plugin? from where have I to start?
- Woocommerce Convert existing order to the cart
- Load style and script for custom post type metabox
- Permissions error when I use my plugin to delete comments in the front-end