Code Duplication    Length = 24-25 lines in 2 locations

core/EE_Error.core.php 1 location

@@ 1013-1037 (lines=25) @@
1010
	 * @param 	bool $force_print
1011
	 * @return 	void
1012
	 */
1013
	private static function _print_scripts( $force_print = FALSE ) {
1014
		if (( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' )) && ! $force_print ) {
1015
			if ( wp_script_is( 'ee_error_js', 'enqueued' )) {
1016
				return;
1017
			} else if ( wp_script_is( 'ee_error_js', 'registered' )) {
1018
				add_filter( 'FHEE_load_css', '__return_true' );
1019
				add_filter( 'FHEE_load_js', '__return_true' );
1020
				wp_enqueue_script( 'ee_error_js' );
1021
				wp_localize_script( 'ee_error_js','ee_settings', array( 'wp_debug'=>WP_DEBUG ));
1022
			}
1023
		} else {
1024
			return '
1025
<script>
1026
/* <![CDATA[ */
1027
var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
1028
/* ]]> */
1029
</script>
1030
<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
1031
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1032
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
1033
';
1034
1035
		}
1036
1037
	}
1038
1039
1040

core/exceptions/BaseException.php 1 location

@@ 475-498 (lines=24) @@
472
	 * @param bool $force_print
473
	 * @return string|void
474
	 */
475
	private static function _print_scripts( $force_print = false ) {
476
		if ( ! $force_print  && ( did_action( 'admin_enqueue_scripts' ) || did_action( 'wp_enqueue_scripts' ) ) ) {
477
			if ( wp_script_is( 'ee_error_js', 'enqueued' ) ) {
478
				return '';
479
			} else if ( wp_script_is( 'ee_error_js', 'registered' ) ) {
480
				add_filter( 'FHEE_load_css', '__return_true' );
481
				add_filter( 'FHEE_load_js', '__return_true' );
482
				wp_enqueue_script( 'ee_error_js' );
483
				wp_localize_script( 'ee_error_js', 'ee_settings', array( 'wp_debug' => WP_DEBUG ) );
484
			}
485
		} else {
486
			return '
487
<script>
488
/* <![CDATA[ */
489
var ee_settings = {"wp_debug":"' . WP_DEBUG . '"};
490
/* ]]> */
491
</script>
492
<script src="' . includes_url() . 'js/jquery/jquery.js" type="text/javascript"></script>
493
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
494
<script src="' . EE_GLOBAL_ASSETS_URL . 'scripts/EE_Error.js' . '?ver=' . espresso_version() . '" type="text/javascript"></script>
495
';
496
		}
497
		return '';
498
	}
499
500
501