Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 15417b5

Browse files
update framework
1 parent 04660f8 commit 15417b5

File tree

4 files changed

+65
-63
lines changed

4 files changed

+65
-63
lines changed

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,17 +371,17 @@
371371
},
372372
{
373373
"name": "wp-content-framework/custom_post",
374-
"version": "v0.0.32",
375-
"version_normalized": "0.0.32.0",
374+
"version": "v0.0.33",
375+
"version_normalized": "0.0.33.0",
376376
"source": {
377377
"type": "git",
378378
"url": "https://github.com/wp-content-framework/custom_post.git",
379-
"reference": "ea2ca68121311cbc29e1823f1110a9c14deeb0a2"
379+
"reference": "cef8510d72c411d78363be190b6b695471ce3203"
380380
},
381381
"dist": {
382382
"type": "zip",
383-
"url": "https://api.github.com/repos/wp-content-framework/custom_post/zipball/ea2ca68121311cbc29e1823f1110a9c14deeb0a2",
384-
"reference": "ea2ca68121311cbc29e1823f1110a9c14deeb0a2",
383+
"url": "https://api.github.com/repos/wp-content-framework/custom_post/zipball/cef8510d72c411d78363be190b6b695471ce3203",
384+
"reference": "cef8510d72c411d78363be190b6b695471ce3203",
385385
"shasum": ""
386386
},
387387
"require": {
@@ -395,7 +395,7 @@
395395
"phake/phake": "~2.0",
396396
"phpunit/phpunit": "~5.7"
397397
},
398-
"time": "2019-04-04T04:27:39+00:00",
398+
"time": "2019-04-23T09:59:54+00:00",
399399
"type": "library",
400400
"installation-source": "dist",
401401
"notification-url": "https://packagist.org/downloads/",

vendor/wp-content-framework/custom_post/src/classes/models/custom_post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* WP_Framework_Custom_Post Classes Models Custom Post
44
*
5-
* @version 0.0.31
5+
* @version 0.0.33
66
* @author Technote
77
* @copyright Technote All Rights Reserved
88
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
@@ -613,7 +613,7 @@ private function is_valid_update( $post_status, $post_type, $untrash = false ) {
613613
'draft',
614614
'pending',
615615
'private',
616-
] ) && $this->is_valid_custom_post_type( $post_type ) && ( $untrash || 'untrash' !== $this->app->input->get( 'action' ) );
616+
] ) && $this->is_valid_custom_post_type( $post_type ) && ( $untrash === ( 'untrash' === $this->app->input->get( 'action' ) ) );
617617
}
618618

619619
/**

vendor/wp-content-framework/custom_post/src/views/admin/script/import_custom_post.php

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* WP_Framework_Custom_Post Views Admin Script Import Custom Post
44
*
5-
* @version 0.0.21
5+
* @version 0.0.33
66
* @author Technote
77
* @copyright Technote All Rights Reserved
88
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
@@ -18,57 +18,59 @@
1818
?>
1919

2020
<script>
21-
( function ( $ ) {
22-
const $button = $( '.page-title-action' );
23-
if ( $button.length ) {
24-
$button.before( '<div class="import-button-wrapper"><input type="file"/><input type="button" value="<?php $instance->h( 'Import from JSON', true );?>" class="import-button button-primary large"/></div>' );
21+
( function( $ ) {
22+
const $button = $( '.page-title-action' );
23+
if ( $button.length ) {
24+
$button.before( '<div class="import-button-wrapper"><input type="file"/><input type="button" value="<?php $instance->h( 'Import from JSON', true );?>" class="import-button button-primary large"/></div>' );
2525

26-
const $wrapper = $('.import-button-wrapper');
27-
let importing = false;
28-
const importing_message = '<?php $instance->h( 'importing', true );?>...';
29-
const result_message = '<div class="result-wrap"><div class="result-message"></div><div><input type="button" class="button-primary large close" value="<?php $instance->h('Close', true);?>"/></div></div>';
30-
$wrapper.find( 'input[type="file"]' ).on( 'change', function () {
31-
if ( this.files.length > 0 ) {
32-
if ( importing ) {
33-
return false;
34-
}
35-
importing = true;
26+
const $wrapper = $( '.import-button-wrapper' );
27+
let importing = false;
28+
const importing_message = '<?php $instance->h( 'importing', true );?>...';
29+
const result_message = '<div class="result-wrap"><div class="result-message"></div><div><input type="button" class="button-primary large close" value="<?php $instance->h( 'Close', true );?>"/></div></div>';
30+
const api_class = window[ '<?php $instance->h( $api_class );?>' ];
31+
const modal_class = window[ '<?php $instance->modal_class();?>' ];
32+
$wrapper.find( 'input[type="file"]' ).on( 'change', function() {
33+
if ( this.files.length > 0 ) {
34+
if ( importing ) {
35+
return false;
36+
}
37+
importing = true;
3638

37-
const formData = new FormData();
38-
formData.append( 'import', this.files[0] );
39-
formData.append( 'post_type', '<?php $instance->h( $post_type );?>' );
40-
window.<?php $instance->h( $api_class );?>.ajax('import_custom_post', formData).done(function (json) {
41-
const close_modal = function() {
42-
if (json.success) {
43-
location.reload();
44-
} else {
45-
window.<?php $instance->modal_class();?>.hide();
46-
}
47-
};
48-
window.<?php $instance->modal_class();?>.show(false, close_modal);
39+
const formData = new FormData();
40+
formData.append( 'import', this.files[ 0 ] );
41+
formData.append( 'post_type', '<?php $instance->h( $post_type );?>' );
42+
api_class.ajax( 'import_custom_post', formData ).done( function( json ) {
43+
const close_modal = function() {
44+
if ( json.success ) {
45+
location.reload();
46+
} else {
47+
modal_class.hide();
48+
}
49+
};
50+
modal_class.show( false, close_modal );
4951

50-
window.<?php $instance->modal_class();?>.show_message(result_message);
51-
window.<?php $instance->modal_class();?>._message().find('.result-message').html(json.message);
52-
window.<?php $instance->modal_class();?>._message().find('.close').on('click', close_modal);
53-
if (json.result) {
54-
window.<?php $instance->modal_class();?>._message().find('.result-message').addClass('updated');
55-
} else {
56-
window.<?php $instance->modal_class();?>._message().find('.result-message').addClass('error');
57-
}
58-
window.<?php $instance->modal_class();?>._set_message_size();
59-
}).fail(function (err) {
60-
window.<?php $instance->modal_class();?>.hide();
61-
console.log(err);
62-
}).always(function () {
63-
importing = false;
64-
});
52+
modal_class.show_message( result_message );
53+
modal_class._message().find( '.result-message' ).html( json.message );
54+
modal_class._message().find( '.close' ).on( 'click', close_modal );
55+
if ( json.result ) {
56+
modal_class._message().find( '.result-message' ).addClass( 'updated' );
57+
} else {
58+
modal_class._message().find( '.result-message' ).addClass( 'error' );
59+
}
60+
modal_class._set_message_size();
61+
} ).fail( function( err ) {
62+
modal_class.hide();
63+
console.log( err );
64+
} ).always( function() {
65+
importing = false;
66+
} );
6567

66-
window.<?php $instance->modal_class();?>.show(true, null, importing_message);
67-
}
68-
} );
69-
$wrapper.find( '.import-button' ).on( 'click', function () {
70-
$wrapper.find( 'input[type="file"]' ).click();
71-
} );
72-
}
73-
} )( jQuery );
68+
modal_class.show( true, null, importing_message );
69+
}
70+
} );
71+
$wrapper.find( '.import-button' ).on( 'click', function() {
72+
$wrapper.find( 'input[type="file"]' ).click();
73+
} );
74+
}
75+
} )( jQuery );
7476
</script>

0 commit comments

Comments
 (0)