Ok. Problem solved. I added plugin as i said to manage autoloader and other stuff. I changed my autoloader and thanks to that i have one in place of 3. Solution was to change one piece of directory with plugin name.This is my autoloader now:
public function xx_main_plugin( $class ) {
$array = explode('\\', $class);
$plugin = str_replace('_', '-', $array[0]);
$dir = str_replace( 'in-this-plugin-is-autoloader', $plugin, __DIR__);
$first = strpos($class, '\\') + 1;
$path = substr( $class, $first);
$path = strtolower( $path );
$path = str_replace( '_', '-', $path );
$path = str_replace( '\\', DIRECTORY_SEPARATOR, $path ) . '.php';
$path = $dir . DIRECTORY_SEPARATOR . $path;
if ( file_exists( $path ) ) {
include $path;
}
}
Related Posts:
- Should all plugins be encapsulated in a Class?
- Registering Class methods as hook callbacks
- Get plugin_dir_url() from one level deep within plugin
- How to use classes declared in another plugin?
- Namespaces in WordPress – How do I initiate the main class?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Adding an admin page – OOP approach not working
- scheduled event not getting executed
- Using the media uploader in a custom plugin
- Trying to get logged-in user data inside php class
- register child class in another plugin
- Check if a class exists within a method
- How to include and use custom class files in plugin?
- Creating a menu page in a Object Oriented developed plugin
- Current user in plugin returns NULL
- How to structure a plugin into multiple files using classes?
- Sage WordPress – Plugin Namespace: Not Found
- Override WP Class Private Function
- Namespaces declared by a theme/plugin should start with the theme/plugin prefix. Found: “eustatos\test_plugin”
- Calling custom plugin class methods from a template
- Getting user roles in plugin files
- Plugin activation hook in an abstract class
- plugin class inheritance. cannot change variable
- Most efficient way to use classes to create admin pages using Settings API
- Basic Object Oriented plugin question
- Using plugin functions/methods within templates
- Widgets Scripts don’t load – but load when I reload the page
- Why namespaces are rarely used in WordPress plugins?
- How to handle cookies from a WordPress plugin on a cached page?
- accessing parent variables in child construct without executing action in parent
- Object method calling for global $wpdb in header.php
- Access WP_REST_Server from within plugin namespace
- Why is my custom post type not being activated on plug-in activation?
- REST route from a plugin not working if WordPress is installed in a subdirectory
- Autoloader not finding classes from my plugin
- How to prevent PHP fatal error if plugin hasn’t been enabled and a method is called in theme file?
- get_option / wp_localize_script Not Working in OOP Plug In
- Built a second plugin but it overwrote the first one
- Override plugin class which has namespace
- profile_update hook doesn’t works inside a class
- WordPress Object Oriented plugin development [closed]
- How to access OOP plugin function inside themes or other plugin
- Plugin: Hooking up classes that have their own hooks
- WordPress Custom Hook with Class method
- FPDF for creating pdf diplomas
- WordPress plugin blog creation
- Woocommerce functions in custom class, avoid errors
- Get post content inside plugin class method
- How to access classes in theme of a plugin?
- worldpay class not working with namespace in WordPress
- accessibility of an object created in a plugin, from the header
- Creating a register settings class that supports extended classes
- Autoloading a PHP class – working outside, but not inside WordPress plugin
- Why function hooked using object are executing at all time?
- How do add_action and WP_Query
- private functions in plugins
- Plugin won’t activate, fatal error (widget class not found)
- OOP Plugin: Where should I place the action hooks in the class?
- Global Handle to Class unavailable in Plugin?
- Strict Standards: Non-static method in sidebar generator
- Plugin: Custom menu item problem
- Function not being called on form submit, only blank admin-post.php page
- Is it possible to use Classes between WordPress plugins with separate namespaces?
- WordPress Action Hook inside Classes
- What is the WordPress approach to custom data?
- Conditional Shipping Options if Certain Products are in Cart WooCommerce
- Readable titles in mobile
- How to do the simplest possible frontend ajax call from a plugin?
- The XXX plugin has been deactivated due to an error: The plugin does not have a valid header
- How can I add “last updated” in plugin descripton?
- get_edit_post_link() not working on wp-cron
- New bulk action to resend welcome emails
- Get site url and updates data, then use them
- How to have a gallery in which each image’s caption is a whole “post”?
- I receive taxonomy id
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- WordPress won’t allow for updates to plugins or WordPress Core
- WordPress Stock Update Programatically
- Loading a plugin’s js file from functions.php
- Woocommerce Backend Search by Title and SKU
- I Setup Rate My Post Plugin On Site But Now Got Issues In Google Webmasters
- How to integrate together a website currently hosted WordPress.com and a custom web application currently hosted on Azure?
- How-to: This block can only be used once
- output html on post or page from custom plugin [closed]
- Custom Post Type – custom form in dashboard
- Problem with add_action
- To perform the requested action, WordPress needs to access your web > server
- Custom API plugin to execute 3rd party API to retrieve data
- Is there a way to convert shortcodes to html content?
- Proper way to handle admin-ajax calls
- How to display the featured post on the category page?
- Disable globally “Crop thumbnail to exact dimensions (normally thumbnails are proportional)” with Multisite
- How to find the list of custom post type where logged in user is author
- UTF-32be error WordPress
- Loop in elementor custom widget not working
- Change text string in a plugin
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- wp-admin send 404 error
- How to create plugin/ page that reads from database
- Stop wordpress from requesting external jquery from googleapi