Good day!
Tell me, can someone make a plugin as a module to the site? Ie, I want, for example, when opening mysite.com/myplugin/, any internal page of the plugin is displayed in public access. Can anyone have examples of how to do this?
Thank you
Good day!
Tell me, can someone make a plugin as a module to the site? Ie, I want, for example, when opening mysite.com/myplugin/, any internal page of the plugin is displayed in public access. Can anyone have examples of how to do this?
Thank you
Create a page myplugin.php , put it, for example, in the root of the folder with the plugin. The following code snippet allows you to check if a page with that name is accessed, and if so, apply the desired template.
add_filter( 'template_include', 'template_include_function', 1 ); function template_include_function( $template_path ) { if(is_page('myplugin')){ $template_path = plugin_dir_path( __FILE__ ) . '/myplugin.php'; } return $template_path; } .htaccess redirect rule, at least to the space even on the plug-in file
Source: https://ru.stackoverflow.com/questions/542619/
All Articles