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-getpermalinknonce'] = wp_create_nonce('getpermalink');
|
||||||
$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
|
$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
|
||||||
$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
|
$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
|
||||||
|
$supplemental['replace-_ajax_linking_nonce'] = wp_create_nonce( 'internal-linking' );
|
||||||
if ( $id ) {
|
if ( $id ) {
|
||||||
if ( $_POST['post_type'] == 'post' )
|
if ( $_POST['post_type'] == 'post' )
|
||||||
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
|
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
|
||||||
|
|
|
@ -16,6 +16,7 @@ var wpLink;
|
||||||
inputs.submit = $('#wp-link-submit');
|
inputs.submit = $('#wp-link-submit');
|
||||||
// URL
|
// URL
|
||||||
inputs.url = $('#url-field');
|
inputs.url = $('#url-field');
|
||||||
|
inputs.nonce = $('#_ajax_linking_nonce');
|
||||||
// Secondary options
|
// Secondary options
|
||||||
inputs.title = $('#link-title-field');
|
inputs.title = $('#link-title-field');
|
||||||
// Advanced Options
|
// Advanced Options
|
||||||
|
@ -569,7 +570,7 @@ var wpLink;
|
||||||
query = {
|
query = {
|
||||||
action : 'wp-link-ajax',
|
action : 'wp-link-ajax',
|
||||||
page : this.page,
|
page : this.page,
|
||||||
'_ajax_linking_nonce' : $('#_ajax_linking_nonce').val()
|
'_ajax_linking_nonce' : inputs.nonce.val()
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( this.search )
|
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( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20110925' );
|
||||||
$scripts->add_data( 'admin-bar', 'group', 1 );
|
$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(
|
$scripts->add_script_data( 'wplink', 'wpLinkL10n', array(
|
||||||
'title' => __('Insert/edit link'),
|
'title' => __('Insert/edit link'),
|
||||||
'update' => __('Update'),
|
'update' => __('Update'),
|
||||||
|
|
Loading…
Reference in New Issue