options_permalink_add_js()
云策文档标注
概述
options_permalink_add_js() 是一个 WordPress 函数,用于在页面中显示 JavaScript。该函数已被弃用,开发者应避免使用。
关键要点
- 函数 options_permalink_add_js() 用于在页面输出 JavaScript 代码。
- 该函数自 WordPress 4.9.0 版本起被弃用,建议开发者寻找替代方案。
- 函数最初在 WordPress 3.5.0 版本中引入。
原文内容
Display JavaScript on the page.
Source
function options_permalink_add_js() {
?>
jQuery( function() {
jQuery('.permalink-structure input:radio').change(function() {
if ( 'custom' == this.value )
return;
jQuery('#permalink_structure').val( this.value );
});
jQuery( '#permalink_structure' ).on( 'click input', function() {
jQuery( '#custom_selection' ).prop( 'checked', true );
});
} );