updated plugin GP Premium version 2.2.0

This commit is contained in:
2022-10-27 11:14:35 +00:00
committed by Gitium
parent 1465186bc5
commit a626bfa106
77 changed files with 418 additions and 152 deletions

View File

@ -128,8 +128,13 @@ class GeneratePress_Elements_Metabox {
public function scripts( $hook ) {
if ( in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {
if ( 'gp_elements' === get_post_type() ) {
// Autosave won't save Element type, so we can't have it.
wp_dequeue_script( 'autosave' );
$element_type = get_post_meta( get_the_ID(), '_generate_element_type', true );
// Remove autosave when dealing with non-content Elements.
// phpcs:ignore -- No data processing happening.
if ( 'block' !== $element_type || ( isset( $_GET['element_type'] ) && 'block' !== $_GET['element_type'] ) ) {
wp_dequeue_script( 'autosave' );
}
$deps = array( 'jquery' );