函数文档

dropdown_link_categories()

💡 云策文档标注

概述

dropdown_link_categories() 是一个已弃用的 WordPress 函数,用于生成链接分类的复选框控件。自 WordPress 2.6.0 起,建议使用 wp_link_category_checklist() 替代。

关键要点

  • 这是一个遗留函数,用于生成链接分类的复选框控件。
  • 自 WordPress 2.6.0 版本起被弃用,推荐使用 wp_link_category_checklist() 函数。
  • 函数接受一个参数 $default_link_category,但未使用。
  • 内部调用 wp_link_category_checklist() 并传递全局变量 $link_id。
  • 弃用信息通过 _deprecated_function() 函数标记。

代码示例

function dropdown_link_categories( $default_link_category = 0 ) {
    _deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
    global $link_id;
    wp_link_category_checklist( $link_id );
}

注意事项

  • 在开发中应避免使用此函数,改用 wp_link_category_checklist() 以确保兼容性和最佳实践。
  • 弃用信息会在函数被调用时触发,提醒开发者更新代码。

📄 原文内容

Legacy function used to generate a link categories checklist control.

Description

See also

Parameters

$default_link_categoryintrequired
Unused.

Source

function dropdown_link_categories( $default_link_category = 0 ) {
	_deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
	global $link_id;
	wp_link_category_checklist( $link_id );
}

Changelog

Version Description
2.6.0 Deprecated. Use wp_link_category_checklist()
2.1.0 Introduced.