Code Duplication    Length = 44-45 lines in 2 locations

modules/custom-css/custom-css-4.7.php 1 location

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

modules/custom-css/custom-css.php 1 location

@@ 1815-1858 (lines=44) @@
1812
	return Jetpack_Custom_CSS::restore_revision( $_post_id, $_revision_id );
1813
}
1814
1815
if ( ! function_exists( 'safecss_class' ) ) :
1816
function safecss_class() {
1817
	// Wrapped so we don't need the parent class just to load the plugin
1818
	if ( class_exists('safecss') )
1819
		return;
1820
1821
	require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
1822
1823
	class safecss extends csstidy_optimise {
1824
1825
		function postparse() {
1826
1827
			/**
1828
			 * Fires after parsing the css.
1829
			 *
1830
			 * @module custom-css
1831
			 *
1832
			 * @since 1.8.0
1833
			 *
1834
			 * @param obj $this CSSTidy object.
1835
			 */
1836
			do_action( 'csstidy_optimize_postparse', $this );
1837
1838
			return parent::postparse();
1839
		}
1840
1841
		function subvalue() {
1842
1843
			/**
1844
			 * Fires before optimizing the Custom CSS subvalue.
1845
			 *
1846
			 * @module custom-css
1847
			 *
1848
			 * @since 1.8.0
1849
			 *
1850
			 * @param obj $this CSSTidy object.
1851
			 **/
1852
			do_action( 'csstidy_optimize_subvalue', $this );
1853
1854
			return parent::subvalue();
1855
		}
1856
	}
1857
}
1858
endif;
1859
1860
if ( ! function_exists( 'safecss_filter_attr' ) ) {
1861
	function safecss_filter_attr( $css, $element = 'div' ) {