Code Duplication    Length = 44-45 lines in 2 locations

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

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

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