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

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