File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed
Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export default (state, action) => {
3434 newState . args = { ...newState . args , ...args , offset : 0 } ;
3535 newState . isOn = true ;
3636
37- if ( updateDefaults && args . post_type . length ) {
37+ if ( updateDefaults && args . post_type ? .length ) {
3838 newState . argsSchema . post_type . default = args . post_type ;
3939 }
4040
Original file line number Diff line number Diff line change @@ -36,26 +36,6 @@ export const formatPrice = (number, options) => {
3636 return format . format ( number ) ;
3737} ;
3838
39- /**
40- * Get the post types from a search form.
41- *
42- * @param {HTMLFormElement } form Form element.
43- * @returns {Array } Post types.
44- */
45- export const getPostTypesFromForm = ( form ) => {
46- const data = new FormData ( form ) ;
47-
48- if ( data . has ( 'post_type' ) ) {
49- return data . getAll ( 'post_type' ) . slice ( - 1 ) ;
50- }
51-
52- if ( data . has ( 'post_type[]' ) ) {
53- return data . getAll ( 'post_type[]' ) ;
54- }
55-
56- return [ ] ;
57- } ;
58-
5939/**
6040 * Get search args from a search form for Instant Results.
6141 *
You can’t perform that action at this time.
0 commit comments