Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autosave = true not working #1499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lexuanbao161096
Copy link
Contributor

No description provided.

Copy link
Contributor

@tanftw tanftw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A mới check phần này, block editor mới sử dụng apiFetch() và wp api để làm autosave, phần JS mình vẫn dùng cách cũ là jquery và ajax nên nếu muốn phần này hoạt động, mình phải viết lại JS thôi.

image

@@ -2,7 +2,7 @@
'use strict';

$( document ).ajaxSend( function ( event, xhr, settings ) {
if ( ! Array.isArray( settings.data ) || -1 === settings.data.indexOf( 'wp_autosave' ) ) {
if ( ( typeof settings.data !== 'string' ) || -1 === settings.data.indexOf( 'wp_autosave' ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hiện tại thì WP dùng apiFetch() để gửi dữ liệu autosave nên phần này không chạy được. E thử dùng cách khác xem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants