Skip to content

Instantly share code, notes, and snippets.

@caercam
Created December 4, 2017 00:35
Show Gist options
  • Save caercam/d89764f06c3e9a9676a7c5b0af702cc6 to your computer and use it in GitHub Desktop.
Save caercam/d89764f06c3e9a9676a7c5b0af702cc6 to your computer and use it in GitHub Desktop.
Active et corrige l'import manuel de films par ID
diff --git a/admin/class-wpmoly-api-wrapper.php b/admin/class-wpmoly-api-wrapper.php
index 6fd55ef..fa6f867 100644
--- a/admin/class-wpmoly-api-wrapper.php
+++ b/admin/class-wpmoly-api-wrapper.php
@@ -419,6 +419,13 @@ if ( ! class_exists( 'WPMOLY_TMDb' ) ) :
}
}
+ $_movie = array(
+ 'result' => 'movie',
+ 'message' => null,
+ 'movies' => array( $_movie ),
+ 'post_id' => $_post_id,
+ );
+
return $_movie;
}
diff --git a/assets/css/admin/wpmoly-edit-movies.css b/assets/css/admin/wpmoly-edit-movies.css
index 0c240f7..4ea60dd 100644
--- a/assets/css/admin/wpmoly-edit-movies.css
+++ b/assets/css/admin/wpmoly-edit-movies.css
@@ -303,7 +303,7 @@
}
#tmdb_search_type {
- display: none;
+ /*display: none;*/
}
#tmdb_search_lang {
diff --git a/assets/js/admin/wpmoly-editor-meta.js b/assets/js/admin/wpmoly-editor-meta.js
index 46c2404..c72e629 100644
--- a/assets/js/admin/wpmoly-editor-meta.js
+++ b/assets/js/admin/wpmoly-editor-meta.js
@@ -131,8 +131,8 @@ wpmoly = wpmoly || {};
data: {
action: 'wpmoly_search_movie',
nonce: wpmoly.get_nonce( 'search-movies' ),
- type: wpmoly_edit_meta.type,
- data: ( wpmoly_edit_meta.type == 'title' ? wpmoly_edit_meta.title : wpmoly_edit_meta.tmdb_id ),
+ type: $( '#tmdb_search_type' ).val() || 'title',
+ data: $( '#tmdb_query' ).val() || '',
lang: wpmoly_edit_meta.lang
},
error: function( response ) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment