将此代码放入函数中。php文件
add_action( \'admin_print_scripts-post.php\', \'wpse22643_overwrite_wplinks\' );
add_action( \'admin_print_scripts-post-new.php\', \'wpse22643_overwrite_wplinks\' );
function wpse22643_overwrite_wplinks( $hook ) {
// register is important, that other plugins will change or deactivate this
wp_register_script(
\'overwrite-wplinks\',
get_stylesheet_directory_uri() . \'/js/overwrite-wplinks.js\',
array( \'jquery\' ),
\'\',
TRUE
);
wp_enqueue_script( \'overwrite-wplinks\' );
}
仔细检查上面要包含的js文件的路径(
/js/overwrite-wplinks.js). 然后将以下代码放在上述js文件中。
( function( $ ) {
if ( typeof wpLink == \'undefined\' )
return;
wpLink.setDefaultValues = function () {
$(\'#link-selector p:nth-child(2).howto\').css(\'display\',\'none\');
};
} )( jQuery );