首页 WordPress函数大全 get_plugin_data()

get_plugin_data()

2020-05-01 / 5165阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_plugin_data( string $plugin_file, bool $markup = true, bool $translate = true )

Parses the plugin contents to retrieve plugin’s metadata.

描述

All plugin headers must be>

参数

$plugin_file

(string)
(Required)
Absolute path to the main plugin file.

$markup

(bool)
(Optional)
If the returned data should have HTML markup applied.

Default value: true

$translate

(bool)
(Optional)
If the returned data should be translated.

Default value: true

返回

(array) Plugin data. Values will be empty if not supplied by the plugin.

  • 'Name'
    (string) Name of the plugin. Should be unique.
  • 'Title'
    (string) Title of the plugin and link to the plugin's site (if set).
  • 'Description'
    (string) Plugin description.
  • 'Author'
    (string) Author's name.
  • 'AuthorURI'
    (string) Author's website address (if set).
  • 'Version'
    (string) Plugin version.
  • 'TextDomain'
    (string) Plugin textdomain.
  • 'DomainPath'
    (string) Plugins relative directory path to .mo files.
  • 'Network'
    (bool) Whether the plugin can only be activated network-wide.
  • 'RequiresWP'
    (string) Minimum required version of WordPress.
  • 'RequiresPHP'
    (string) Minimum required version of PHP.
大家谈论
    我的见解