| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | 'admin_enqueue_scripts', |
| 25 | 25 | function () { |
| 26 | 26 | $wppb_module_settings = get_option( 'wppb_module_settings', 'not_found' ); |
| 27 | 27 | |
| 28 | - $registration_form_options[] = [ "label" => __( 'Default' , 'profile-builder' ), "value" => "" ]; | |
| 28 | + $registration_form_options = array(); | |
| 29 | 29 | |
| 30 | 30 | if ( !( ( $wppb_module_settings !== 'not_found' && ( |
| 31 | 31 | !isset( $wppb_module_settings['wppb_multipleRegistrationForms'] ) || |
| 32 | 32 | $wppb_module_settings['wppb_multipleRegistrationForms'] !== 'show' |
| @@ -31,10 +31,17 @@ | ||
| 31 | 31 | !isset( $wppb_module_settings['wppb_multipleRegistrationForms'] ) || |
| 32 | 32 | $wppb_module_settings['wppb_multipleRegistrationForms'] !== 'show' |
| 33 | 33 | ) ) || |
| 34 | 34 | $wppb_module_settings === 'not_found' ) ){ |
| 35 | + // Published forms only. WP_Query adds the admin-visible protected | |
| 36 | + // statuses (draft, pending, future, private) when it runs in the | |
| 37 | + // admin, and this list is built on admin_enqueue_scripts — so | |
| 38 | + // without the explicit status a draft form would be offered here | |
| 39 | + // while its form_name resolves to nothing on the front end (the | |
| 40 | + // resolver queries post_status = 'publish'). | |
| 35 | 41 | $args = array( |
| 36 | 42 | 'post_type' => 'wppb-rf-cpt', |
| 43 | + 'post_status' => 'publish', | |
| 37 | 44 | 'posts_per_page' => -1 |
| 38 | 45 | ); |
| 39 | 46 | |
| 40 | 47 | $the_query = new WP_Query( $args ); |