Code Duplication    Length = 44-45 lines in 2 locations

projects/plugins/jetpack/modules/custom-css/custom-css-4.7.php 1 location

@@ 1133-1177 (lines=45) @@
1130
1131
Jetpack_Custom_CSS_Enhancements::add_hooks();
1132
1133
if ( ! function_exists( 'safecss_class' ) ) :
1134
	/**
1135
	 * Load in the class only when needed.  Makes lighter load by having one less class in memory.
1136
	 */
1137
	function safecss_class() {
1138
		// Wrapped so we don't need the parent class just to load the plugin.
1139
		if ( class_exists( 'safecss' ) ) {
1140
			return;
1141
		}
1142
1143
		require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
1144
1145
		/**
1146
		 * Class safecss
1147
		 */
1148
		class safecss extends csstidy_optimise {
1149
1150
			/**
1151
			 * Optimises $css after parsing.
1152
			 */
1153
			function postparse() {
1154
1155
				/** This action is documented in modules/custom-css/custom-css.php */
1156
				do_action( 'csstidy_optimize_postparse', $this );
1157
1158
				return parent::postparse();
1159
			}
1160
1161
			/**
1162
			 * Optimises a sub-value.
1163
			 */
1164
			function subvalue() {
1165
1166
				/** This action is documented in modules/custom-css/custom-css.php */
1167
				do_action( 'csstidy_optimize_subvalue', $this );
1168
1169
				return parent::subvalue();
1170
			}
1171
		}
1172
	}
1173
endif;
1174

projects/plugins/jetpack/modules/custom-css/custom-css.php 1 location

@@ 1851-1894 (lines=44) @@
1848
	return Jetpack_Custom_CSS::restore_revision( $_post_id, $_revision_id );
1849
}
1850
1851
if ( ! function_exists( 'safecss_class' ) ) :
1852
function safecss_class() {
1853
	// Wrapped so we don't need the parent class just to load the plugin
1854
	if ( class_exists('safecss') )
1855
		return;
1856
1857
	require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
1858
1859
	class safecss extends csstidy_optimise {
1860
1861
		function postparse() {
1862
1863
			/**
1864
			 * Fires after parsing the css.
1865
			 *
1866
			 * @module custom-css
1867
			 *
1868
			 * @since 1.8.0
1869
			 *
1870
			 * @param obj $this CSSTidy object.
1871
			 */
1872
			do_action( 'csstidy_optimize_postparse', $this );
1873
1874
			return parent::postparse();
1875
		}
1876
1877
		function subvalue() {
1878
1879
			/**
1880
			 * Fires before optimizing the Custom CSS subvalue.
1881
			 *
1882
			 * @module custom-css
1883
			 *
1884
			 * @since 1.8.0
1885
			 *
1886
			 * @param obj $this CSSTidy object.
1887
			 **/
1888
			do_action( 'csstidy_optimize_subvalue', $this );
1889
1890
			return parent::subvalue();
1891
		}
1892
	}
1893
}
1894
endif;
1895
1896
if ( ! function_exists( 'safecss_filter_attr' ) ) {
1897
	function safecss_filter_attr( $css, $element = 'div' ) {