| @@ 1807-1850 (lines=44) @@ | ||
| 1804 | return Jetpack_Custom_CSS::restore_revision( $_post_id, $_revision_id ); |
|
| 1805 | } |
|
| 1806 | ||
| 1807 | if ( ! function_exists( 'safecss_class' ) ) : |
|
| 1808 | function safecss_class() { |
|
| 1809 | // Wrapped so we don't need the parent class just to load the plugin |
|
| 1810 | if ( class_exists('safecss') ) |
|
| 1811 | return; |
|
| 1812 | ||
| 1813 | require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' ); |
|
| 1814 | ||
| 1815 | class safecss extends csstidy_optimise { |
|
| 1816 | ||
| 1817 | function postparse() { |
|
| 1818 | ||
| 1819 | /** |
|
| 1820 | * Fires after parsing the css. |
|
| 1821 | * |
|
| 1822 | * @module custom-css |
|
| 1823 | * |
|
| 1824 | * @since 1.8.0 |
|
| 1825 | * |
|
| 1826 | * @param obj $this CSSTidy object. |
|
| 1827 | */ |
|
| 1828 | do_action( 'csstidy_optimize_postparse', $this ); |
|
| 1829 | ||
| 1830 | return parent::postparse(); |
|
| 1831 | } |
|
| 1832 | ||
| 1833 | function subvalue() { |
|
| 1834 | ||
| 1835 | /** |
|
| 1836 | * Fires before optimizing the Custom CSS subvalue. |
|
| 1837 | * |
|
| 1838 | * @module custom-css |
|
| 1839 | * |
|
| 1840 | * @since 1.8.0 |
|
| 1841 | * |
|
| 1842 | * @param obj $this CSSTidy object. |
|
| 1843 | **/ |
|
| 1844 | do_action( 'csstidy_optimize_subvalue', $this ); |
|
| 1845 | ||
| 1846 | return parent::subvalue(); |
|
| 1847 | } |
|
| 1848 | } |
|
| 1849 | } |
|
| 1850 | endif; |
|
| 1851 | ||
| 1852 | if ( ! function_exists( 'safecss_filter_attr' ) ) { |
|
| 1853 | function safecss_filter_attr( $css, $element = 'div' ) { |
|
| @@ 1039-1083 (lines=45) @@ | ||
| 1036 | ||
| 1037 | Jetpack_Custom_CSS_Enhancements::add_hooks(); |
|
| 1038 | ||
| 1039 | if ( ! function_exists( 'safecss_class' ) ) : |
|
| 1040 | /** |
|
| 1041 | * Load in the class only when needed. Makes lighter load by having one less class in memory. |
|
| 1042 | */ |
|
| 1043 | function safecss_class() { |
|
| 1044 | // Wrapped so we don't need the parent class just to load the plugin |
|
| 1045 | if ( class_exists('safecss') ) { |
|
| 1046 | return; |
|
| 1047 | } |
|
| 1048 | ||
| 1049 | require_once( dirname( __FILE__ ) . '/csstidy/class.csstidy.php' ); |
|
| 1050 | ||
| 1051 | /** |
|
| 1052 | * Class safecss |
|
| 1053 | */ |
|
| 1054 | class safecss extends csstidy_optimise { |
|
| 1055 | ||
| 1056 | function postparse() { |
|
| 1057 | ||
| 1058 | /** |
|
| 1059 | * Fires after parsing the css. |
|
| 1060 | * |
|
| 1061 | * @module custom-css |
|
| 1062 | * |
|
| 1063 | * @since 1.8.0 |
|
| 1064 | * |
|
| 1065 | * @param obj $this CSSTidy object. |
|
| 1066 | */ |
|
| 1067 | do_action( 'csstidy_optimize_postparse', $this ); |
|
| 1068 | ||
| 1069 | return parent::postparse(); |
|
| 1070 | } |
|
| 1071 | ||
| 1072 | function subvalue() { |
|
| 1073 | ||
| 1074 | /** |
|
| 1075 | * Fires before optimizing the Custom CSS subvalue. |
|
| 1076 | * |
|
| 1077 | * @module custom-css |
|
| 1078 | * |
|
| 1079 | * @since 1.8.0 |
|
| 1080 | * |
|
| 1081 | * @param obj $this CSSTidy object. |
|
| 1082 | **/ |
|
| 1083 | do_action( 'csstidy_optimize_subvalue', $this ); |
|
| 1084 | ||
| 1085 | return parent::subvalue(); |
|
| 1086 | } |
|