函数文档

_thickbox_path_admin_subfolder()

💡 云策文档标注

概述

该函数用于在 Network Admin 中输出 thickbox 图片路径,是 WordPress 核心函数的一部分。

关键要点

  • 函数 _thickbox_path_admin_subfolder() 专门处理 Network Admin 环境下的 thickbox 图片路径输出
  • 该函数自 WordPress 3.1.0 版本引入,属于核心功能
  • 相关函数包括 esc_js() 和 includes_url(),分别用于转义 JavaScript 和获取 includes 目录 URL

📄 原文内容

Prints thickbox image paths for Network Admin.

Source

function _thickbox_path_admin_subfolder() {
?>
<script type="text/javascript">
var tb_pathToImage = "<?php echo esc_js( includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ) ); ?>";
</script>
</pre><p class="wporg-dot-link-list"><a href="https://developer.wordpress.org/reference/files/wp-admin/includes/ms.php/">View all references</a> <a href="https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-admin/includes/ms.php#L848">View on Trac</a> <a href="https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/ms.php#L848-L854">View on GitHub</a></p></section>

<section class="wp-block-wporg-code-reference-related" data-nosnippet="true"><h2 id="related" class="is-toc-heading wp-block-heading has-heading-5-font-size" tabindex="-1" ><a href="#related">Related</a></h2> <section style="margin-top:var(--wp--preset--spacing--20)" class="wp-block-wporg-code-table" id="uses"><figure class="wp-block-table "><table><thead><tr><th scope="col">Uses</th><th scope="col">Description</th></tr></thead><tbody><tr class=""><td><a href="https://developer.wordpress.org/reference/functions/esc_js/">esc_js()</a><code>wp-includes/formatting.php

Escapes single quotes, ", , &, and fixes line endings.

includes_url()wp-includes/link-template.php

Retrieves the URL to the includes directory.

Changelog

Version Description
3.1.0 Introduced.