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
檢視更多 >