When using plugin_dir_path()
like you do:
plugin_dir_path( __FILE__ );
It does return something like:
/var/www//wordpress/wp-content/plugins/your-plugin/
So it adds a trailing slash, because as the documentation states:
It is a wrapper for
trailingslashit( dirname( $file ) );
.
So remove the slash before the file in your calls:
require_once plugin_dir_path( __FILE__ ) . 'file.php';
Related Posts:
- Why does including a file in theme’s functions.php not work?
- Creating plugin using simple_html_dom parser?
- show Visual form builder in the front end
- php include returns 1 as output with other outputs [closed]
- Display file contents within Plugin
- Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?
- is_plugin_active() returning false on active plugin
- Unable to check if plugin is active
- Why do I get this “plugin does not have a valid header” error?
- Edit plugin without hooks in functions.php
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- Editor access to plugin settings
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- How to use a Must-Use plugin to hide a regular one and to hide itself?
- Shortcode display outside the div
- Insert code after tag without using functions.php?
- Why load_textdomain work but not load_plugin_textdomain?
- Extend the Admin Post/Edit page
- Unable to load stylesheets and scripts to plugin settings page
- Correct way to use register_activation_hook
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Licensing of freemium plugin
- $wpdb working with ajax but showing ajax error instead of success
- How to trigger an action with a URL
- Default Plugin Settings Not Writing to Database
- Create a custom page template inside my wordpress plugin
- How to pull code snippet from functionality plugin?
- White page on custom plugin option submit
- Best approach to fetch data from wp options to js file or php file
- Is it possible to create Custom Post plug-in?
- How to add Internationalization in WordPress using Javascript/React?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- creating html reusable blocks via shortcodes
- I want to auto populate data in three fields if one drop down is selected
- How does task scheduler plugin implements cron that is not dependent on page load request? [closed]
- Session destroyed on page redirect
- how to use in custom single.php template using php?
- How can I change the meta_key for a particular piece of information?
- Can I load the textdomain before a plugin is activated?
- Howto check version of another plugin and then add a submenu page to it
- Which file of wordpress manage plugins functionalities?
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- I should enable automatic updates?
- Settings API saved values not getting shown in the dropdownbox
- How to add custom table style for table block in gutenberg editor
- Issues with a WP plugin menu system
- Different custom templates for product category [closed]
- Why Does The `auto_update_plugin` Hook Disable Management?
- Add a “View all” button on WooCommerce product archives pages
- Is there a script to collect all hooks and filters provided by a plugin?
- How do I add an options page at the bottom of the list?
- Post status doesn’t update to ‘future’ every time?
- Unable to give correct path in wordpress
- Disable variations on woo commerce if out of stock
- How to add img into a plugin?
- A question of etiquette when forking a plugin? [closed]
- how to request a script more than once in wordpress
- How to log custom plugin error to debug.log file
- Gutenberg default attributes are empty when accessing in edit
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- How to create admin setting for this small plugin
- Hide all Admin Notices and move on a separate page
- How to fix caching issue in PHP data from database
- Show Custom Post on Frontend
- Adding shortcodes to multiple pages with function
- SASS not showing in customized preloader plugin
- How to securely controlling data without keeping it in postmeta?
- Get a list of Product Categories inside a loop
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Load my Inline js footer area
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- Using multi-dimensional array with filter
- WordPress Admin sub-level menu issue
- WordPress plugin changes not updating
- PHP header() not available to use in my plugin
- wordpress ajax pagination object value does not change
- Google analytic issue in wordpress
- Custom pages with plugin
- How to insert category name above post title in a featured pages plugin?
- Displaying friend’s posts only
- What’s the preferred method of writing AJAX-enabled plugins?
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Shortcode registered from a plugin not recognized
- Check if user is in a group of another site within multisite network [closed]
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Redirect url in plugin to somewhere else?
- wp_update_post call really slow when official Facebook plugin is installed
- How to set-up multiple cron task with wp_schedule_event so that they do not overlap?
- Site is setup statically – how to make it content managable?
- White Screen When Includding A Folder With PHP Files
- Modifying lightbox plugin to allow for quoting, Does this exist? [closed]
- Plugin version number after code rewrite [closed]
- How to escape html code?
- Create Custom Coupon Type
- How to provide page_template path in custom plugin using WordPress
- WordPress custom block: Link saved in database not retrieved when editing post
- Accessing Correct Database to Create REST API Endpoint
- Detect if user is on the specific page in WordPress
- A multi-section WordPress store [closed]