Code Duplication    Length = 42-43 lines in 2 locations

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

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

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

@@ 746-788 (lines=43) @@
743
744
Jetpack_Custom_CSS_Enhancements::add_hooks();
745
746
function safecss_class() {
747
	// Wrapped so we don't need the parent class just to load the plugin
748
	if ( class_exists('safecss') ) {
749
		return;
750
	}
751
752
	require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' );
753
754
	class safecss extends csstidy_optimise {
755
756
		function postparse() {
757
758
			/**
759
			 * Fires after parsing the css.
760
			 *
761
			 * @module custom-css
762
			 *
763
			 * @since 1.8.0
764
			 *
765
			 * @param obj $this CSSTidy object.
766
			 */
767
			do_action( 'csstidy_optimize_postparse', $this );
768
769
			return parent::postparse();
770
		}
771
772
		function subvalue() {
773
774
			/**
775
			 * Fires before optimizing the Custom CSS subvalue.
776
			 *
777
			 * @module custom-css
778
			 *
779
			 * @since 1.8.0
780
			 *
781
			 * @param obj $this CSSTidy object.
782
			 **/
783
			do_action( 'csstidy_optimize_subvalue', $this );
784
785
			return parent::subvalue();
786
		}
787
	}
788
}
789