options_permalink_add_js

函数
options_permalink_add_js ( No parameters )

options_permalink_add_js: 这个钩子用来在WordPress管理区的Permalink设置页面上添加JavaScript代码。这可以用来添加自定义功能或修改页面的现有功能。

在页面上显示JavaScript。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function options_permalink_add_js() {
?>
<script type="text/javascript">
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 );
});
} );
</script>
<?php
}
function options_permalink_add_js() { ?> <script type="text/javascript"> 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 ); }); } ); </script> <?php }
function options_permalink_add_js() {
	?>
	<script type="text/javascript">
		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 );
			});
		} );
	</script>
	<?php
}

常见问题

FAQs
查看更多 >