Fix edit slug ajax nonce. props nbachiyski. see #5816
git-svn-id: https://develop.svn.wordpress.org/trunk@6788 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ce8098c1df
commit
1d038f7c24
@ -525,7 +525,7 @@ case 'closed-postboxes' :
|
||||
update_usermeta($current_user->ID, 'closedpostboxes_'.$page, $closed);
|
||||
break;
|
||||
case 'sample-permalink':
|
||||
check_ajax_referer( $action );
|
||||
check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
|
||||
$post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
|
||||
die(get_sample_permalink_html($post_id, $_POST['new_slug']));
|
||||
break;
|
||||
|
@ -90,6 +90,7 @@ addLoadEvent(focusit);
|
||||
<?php the_editor($post->post_content); ?>
|
||||
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
|
||||
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
||||
<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
|
||||
</div>
|
||||
|
||||
<?php echo $form_pingback ?>
|
||||
|
@ -14,7 +14,7 @@ function edit_permalink(post_id) {
|
||||
action: 'sample-permalink',
|
||||
post_id: post_id,
|
||||
new_slug: new_slug,
|
||||
cookie: document.cookie}, function(data) {
|
||||
samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) {
|
||||
jQuery('#sample-permalink').html(data);
|
||||
b.html(revert_b);
|
||||
real_slug.attr('value', new_slug);
|
||||
|
Loading…
Reference in New Issue
Block a user