mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Cache internal linking nonce jQuery object. props mitchoyoshitaka. Update this nonce through autosave. fixes #18403.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2a38f122ab
commit
f186494c9a
@ -998,6 +998,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
$supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink');
|
||||
$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
|
||||
$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
|
||||
$supplemental['replace-_ajax_linking_nonce'] = wp_create_nonce( 'internal-linking' );
|
||||
if ( $id ) {
|
||||
if ( $_POST['post_type'] == 'post' )
|
||||
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
|
||||
|
@ -16,6 +16,7 @@ var wpLink;
|
||||
inputs.submit = $('#wp-link-submit');
|
||||
// URL
|
||||
inputs.url = $('#url-field');
|
||||
inputs.nonce = $('#_ajax_linking_nonce');
|
||||
// Secondary options
|
||||
inputs.title = $('#link-title-field');
|
||||
// Advanced Options
|
||||
@ -569,7 +570,7 @@ var wpLink;
|
||||
query = {
|
||||
action : 'wp-link-ajax',
|
||||
page : this.page,
|
||||
'_ajax_linking_nonce' : $('#_ajax_linking_nonce').val()
|
||||
'_ajax_linking_nonce' : inputs.nonce.val()
|
||||
};
|
||||
|
||||
if ( this.search )
|
||||
|
File diff suppressed because one or more lines are too long
@ -261,7 +261,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20110925' );
|
||||
$scripts->add_data( 'admin-bar', 'group', 1 );
|
||||
|
||||
$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), '20110802', 1 );
|
||||
$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), '20110929', 1 );
|
||||
$scripts->add_script_data( 'wplink', 'wpLinkL10n', array(
|
||||
'title' => __('Insert/edit link'),
|
||||
'update' => __('Update'),
|
||||
|
Loading…
Reference in New Issue
Block a user