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
- Capture the Selected Radio Button Value between two files in wordpress theme
- Include WP_Query in my own PHP file?
- Include a external PHP file into a WordPress Custom Template
- Remove option to allow trackbacks/pingbacks from post page options
- How to use update and delete query in wordpress
- add_meta_boxes action with refresh on save
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- Hiding WordPress Plugin Source Code
- wp_loaded hook block script enquequing
- Change the site tagline (or similar) based on current page
- create a select input with menus created on a custom options page
- Custom filter in admin edit custom post type responding with invalid post type?
- How to find error in my code when the error message is pointing to WP core file?
- How to access global variable $menu inside a class function
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- How to upload a file to a folder named after the user_id via plugin
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- adjust section according to country?
- Customize position of social icons in upme plugin [closed]
- Accessing an image folder inside public web directory
- Media Upload , file name changed automatically
- Replace shortcode in substring
- “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?
- PHP in CSS file?
- 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
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Cant register rest routs from class instance
- Where is the PHP code generating an element?
- Basic wpdb update question
- 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
- 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?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Is it possible to access admin-ajax.php using PHP?
- 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?
- Woocommerce template file outputting tags
- Reliable way to add nonce to HTTP Header in WordPress?
- Trying to update Woocommerce meta values
- Getting an error when my plugin is updated, but the files update correctly
- ssl redirect function is not working
- If Statement is Ignored?
- Gutenberg blocks shortcodes compatibility
- Save custom field on WP_List_Table
- Load script and styles using an array of resources
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- Create Schema in WordPress with PHP
- Woocommerce list variations that are added already to cart in Single Product
- 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?
- Resource 404 error on multisite subdirectory install
- 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?
- 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
- Pagination on Custom Loop
- MySQL Engine vs. Charset
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- Select area and checkbox data is not saving?
- In reading settings posts are set to “blog” and I have page-blog.php but no posts
- using a shortcode in a hyperlink
- Login user into magento using wordpress account
- Customize create table SQL statement in any WordPress plugin
- Does it make sense to sanitize the output of an SVG file?