From a415c29efee45520ae252d2aa28f1083a521cd7b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:56:49 +0200 Subject: Adding upstream version 6.4.3+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/class-wp-dependency.php | 139 ++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 wp-includes/class-wp-dependency.php (limited to 'wp-includes/class-wp-dependency.php') diff --git a/wp-includes/class-wp-dependency.php b/wp-includes/class-wp-dependency.php new file mode 100644 index 0000000..bcc7808 --- /dev/null +++ b/wp-includes/class-wp-dependency.php @@ -0,0 +1,139 @@ +handle, $this->src, $this->deps, $this->ver, $this->args ) = $args; + if ( ! is_array( $this->deps ) ) { + $this->deps = array(); + } + } + + /** + * Add handle data. + * + * @since 2.6.0 + * + * @param string $name The data key to add. + * @param mixed $data The data value to add. + * @return bool False if not scalar, true otherwise. + */ + public function add_data( $name, $data ) { + if ( ! is_scalar( $name ) ) { + return false; + } + $this->extra[ $name ] = $data; + return true; + } + + /** + * Sets the translation domain for this dependency. + * + * @since 5.0.0 + * + * @param string $domain The translation textdomain. + * @param string $path Optional. The full file path to the directory containing translation files. + * @return bool False if $domain is not a string, true otherwise. + */ + public function set_translations( $domain, $path = '' ) { + if ( ! is_string( $domain ) ) { + return false; + } + $this->textdomain = $domain; + $this->translations_path = $path; + return true; + } +} -- cgit v1.2.3