| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | if ( ! isset( $slug ) ) { |
| 30 | 30 | $slug = 'formidable-applications'; |
| 31 | - $callback = array( self::class, 'landing_page' ); | |
| 31 | + $callback = array( __CLASS__, 'landing_page' ); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | add_submenu_page( 'formidable', 'Formidable | ' . $label, $label, $cap, $slug, $callback ); |
| 35 | 35 | } |
| @@ -130,9 +130,9 @@ | ||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | FrmApplicationTemplate::init(); |
| 133 | 133 | |
| 134 | - return array_reduce( $applications, array( self::class, 'reduce_template' ), array() ); | |
| 134 | + return array_reduce( $applications, array( __CLASS__, 'reduce_template' ), array() ); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | 138 | * @param array $total the accumulated array of reduced application data. |
| @@ -140,14 +140,9 @@ | ||
| 140 | 140 | * @return array<array> |
| 141 | 141 | */ |
| 142 | 142 | private static function reduce_template( $total, $current ) { |
| 143 | 143 | $template = new FrmApplicationTemplate( $current ); |
| 144 | - | |
| 145 | - $js_object = $template->as_js_object(); | |
| 146 | - if ( $js_object ) { | |
| 147 | - $total[] = $js_object; | |
| 148 | - } | |
| 149 | - | |
| 144 | + $total[] = $template->as_js_object(); | |
| 150 | 145 | return $total; |
| 151 | 146 | } |
| 152 | 147 | |
| 153 | 148 | /** |
| @@ -158,9 +153,9 @@ | ||
| 158 | 153 | */ |
| 159 | 154 | private static function sort_templates( $applications ) { |
| 160 | 155 | usort( |
| 161 | 156 | $applications, |
| 162 | - function ( $a, $b ) { | |
| 157 | + function( $a, $b ) { | |
| 163 | 158 | return strcmp( $a['name'], $b['name'] ); |
| 164 | 159 | } |
| 165 | 160 | ); |
| 166 | 161 | return $applications; |
| @@ -201,9 +196,8 @@ | ||
| 201 | 196 | ); |
| 202 | 197 | wp_localize_script( 'formidable_applications', 'frmApplicationsVars', $js_vars ); |
| 203 | 198 | |
| 204 | 199 | wp_enqueue_script( 'formidable_applications' ); |
| 205 | - wp_set_script_translations( 'formidable_applications', 'formidable' ); | |
| 206 | 200 | wp_enqueue_style( 'formidable_applications' ); |
| 207 | 201 | |
| 208 | 202 | do_action( 'frm_applications_assets' ); |
| 209 | 203 | } |
| @@ -212,9 +206,11 @@ | ||
| 212 | 206 | * @return void |
| 213 | 207 | */ |
| 214 | 208 | public static function dequeue_scripts() { |
| 215 | 209 | if ( 'formidable-applications' === FrmAppHelper::simple_get( 'page', 'sanitize_title' ) ) { |
| 216 | - FrmAppHelper::dequeue_extra_global_scripts(); | |
| 210 | + // Avoid extra scripts loading on applications index that aren't needed. | |
| 211 | + wp_dequeue_script( 'frm-surveys-admin' ); | |
| 212 | + wp_dequeue_script( 'frm-quizzes-form-action' ); | |
| 217 | 213 | } |
| 218 | 214 | } |
| 219 | 215 | |
| 220 | 216 | /** |