Code Duplication    Length = 44-45 lines in 2 locations

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

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

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' ) {