I do it like this:
// Inclusion of additional php files
define( 'MYPLUG_DIR', plugin_dir_path( __FILE__ ) );
require_once( MYPLUG_DIR . 'hi.php' );
It lets you use that more easily if you have to include several files.
Related Posts:
- Consuming an external API in WordPress?
- WP Post Template – Templates in own folder
- Perform internal redirect in WordPress?
- Pagination shows Same posts
- Change Jobs for WordPress templates
- How to echo a plugin’s function into a template?
- How to make a Template page to show the information of different things Shop and Product page?
- Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron
- Using require_once in a Plugin?
- Simple form that saves to database
- How to call plugin path in JS?
- Get Current user email as a return string value
- How can I make content disappear when a user logs in?
- Plugin.php: PHP Notice: Undefined offset: 0 in
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Custom url structure for custom template
- Determining where fopen() is writing files when used from WordPress AJAX call [closed]
- New Plugin: Post update pushes a copy as a revision
- Overide a function that is inside a plugin
- How to get images from EDD post?
- How to install and activate a plugin via an external PHP script
- How to remove xmlns on language_attributes()?
- Woocommerce email template customization [closed]
- Prevent a plugin from being automatically activated
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- Saving changes in wp_editor
- Output array into one table cell
- Register Page Template from Plugin
- Using meta_query to get date type values from post_meta table WordPress
- Using plugin functions/methods within templates
- How can integrate zend module with wordpress admin dashbord [closed]
- Woocommerce Show Single Product on Homepage
- Setup wp_schedule_event within a custom plugin
- Does having more than 30 Admin Ajax affects site performance (plugin)?
- execute function after one completed
- WHy custom plugin slows down the loading of the pages?
- Adding media upload button to User Profile page (following a tutorial)
- How to get specific string/value from an array? php [closed]
- WordPress Stock Update Programatically
- UTF-32be error WordPress
- Background Music WP [closed]
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Why is it important to check for isset and is_array before checking in_array in this example?
- How to delete a theme using AJAX
- How to call external functions from a PHP script in a WordPress plugin?
- same user role or copy the user role to be same as the other role
- Equivalent of admin.php for public pages
- Social share buttons text shows up on post excerpts
- How to add custom function to pluggable.php
- How to displaying Custom image, text and default image logo from Redux Framework option panel
- Plugin Admin panel checkbox unchecked after submit
- Getting URL GET parameter with Code snippets and storing it in database?
- WooCommerce – new order email hook
- How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks?
- save_post_product action not firing
- How to get the custom field value using SQL query
- How to list datas from database in a topic?
- Editing a coupon generating plugin
- WordPress fatal error from php protocol codes
- How use wp_insert_post and add og:custom tags?
- Display pagination in reservation Plugin and and Print table as pdf
- Changing wordpress/woocommerce notices default message to other languages (text)
- Why does my custom plugin only function correctly once per page?
- How to change “Read More” text?
- How to change a wordress plugin php code in my child’s functions.php file?
- What is the right way to populate a dropdown from MySql?
- make p tag collapsed after 3 rows
- I can’t view the orders on the woocomerce dashboard with the brainblocks plugin
- WordPress Plugin PHP Not Calling Function
- load plugin in code snippet
- Generate and send ICS file through WordPress
- WP Plugin permissions – create new files
- Run a Change Role Cron Job on WordPress via cPanel
- How to display variables from plugin?
- How to make the first letter of a post title uppercase, in a plugin?
- Creating Admin Submenu Page via Class Method
- .htaccess file doesn’t work, with hundred tries
- How to change the product short description for each product with PHP?
- ACF Repeater Field Question [closed]
- How to create a dashboard for logged-in users with custom functionality? [closed]
- Cannot access variables within a widget
- How do I convince this button to do something when it is clicked?
- WordPress function to add text
- TheCartPress plugin – Make every item in store unique
- Postal address auto-complete on profile page
- Doing action based on input from options menu
- Insert dynamic content into posts
- WordPress Related Plugin – Adding an image
- WordPress User Frontend Editing Custom Fields
- My wordpress site wont load, it gives header error warnings
- Can anyone see a syntax error in this? [closed]
- Strict Standards: Non-static method in sidebar generator
- Fast Tranfering my WordPress site to another server
- Duplicating wordpress install issue
- wp_handle_upload – specified file failed upload test
- How to change all the urls of the WordPress site?
- How do I remove the filter from the orders and add custom status in Dokan?
- Split Million WordPress Post’s Into Multiple Database Server
- I want to allow certain file types on dokan upload files
- How to create different woocommerce single_product.php pages for each product? [closed]