Fix edit slug ajax nonce. props nbachiyski. see #5816
git-svn-id: http://svn.automattic.com/wordpress/trunk@6788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1e4cf4d54d
commit
2b7ea6a824
|
@ -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