How does Wordpress read the comment title?

I am working on my own small database for future clients, and I create a folder called "Forms" to store all my forms for interacting with CMS. Inside the forms folder, I would like to store .php files similar to wordpress plugins, which I can name in the comment code, for example wp, ... i.e.

/*
Plugin Name: Name Of The Plugin
Description: A brief description of the Plugin.
Version: The Plugin Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
*/

I am wondering how WP reads this data as it is commented out ... they use file_get_contents ('plugin.php'); and analyze it, and also enable the plugin? Is there a php function to actually read comments?

Thoughts?

+3
source share
2 answers
  • Read the file via FTP or file_Get_contents () `
  • explode : array
  • array[0] array[1] .
+3

Wordpress . Total Widget Control. , .

get_file_data ($ file_path, $headers, $context)

string $file:

array $default_headers: format ('HeaderKey' = > ' ')

string $context: , "extra _ {$ context} _headers"

+3

Source: https://habr.com/ru/post/1763661/


All Articles