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?
- Best way to overide plugin CSS?
- Ways to create a paid wordpress plugin?
- How to include a plugin’s php file to another plugin functions file [duplicate]
- How can I bulk edit variations in woocommerce? [closed]
- How to register_sidebar() without messing up the order?
- How to find out if option exists but is empty?
- Template for different category on woocommerce product [closed]
- Reduce nonce lifespan
- Trigger a custom wordpress plugin with a linux cron
- Add Products to user’s ID Woocommerce
- Add_rewrite_rule doesn’t add custom url in plugin
- Allow a userclass to save a page as a draft – but not publish w/o admin approval
- Fatal error: Uncaught Error: Call to undefined function get_userdata()
- Custom options page checkbox will not save, despite working with text
- How to add inline css/js inside a shortcode
- taxonomy_template filter do not loads custom taxonomy template properly
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- Ajax with jQuery UI dialog not working
- Editing Theme to apply Co-Authors Plus
- Display comments of users on single page
- How do you remove plugin edit option?
- Localiztion in javascript
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- I am getting error message on accessing menu-endpoint
- Where should I save an API key of my user when installing my plugin?
- Set featured image randomly from WordPress Database on post submission
- Headers Content-Security-Policy CSP Major Issue
- Timed Exam test for candidates [closed]
- There has been a critical error on your website. Please check your site admin email inbox for instructions.Learn more about debugging in WordPress [closed]
- Woocommerce Deposit, then random payments until product paid in full [closed]
- How do I run SQL queries on a WordPress web page? [closed]
- Remove strange code from wordpress footer [closed]
- Submit page limited in time to upload image
- Modal suddenly disapearring [closed]
- media page returnig to 404 in rtmedia [closed]
- Remove Woocomerce shop page
- Setting up PubSubHubbub (PUSH) with WordPress