From a95731c6145afa3ee76f366a00dde6a24f3f2f64 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Mon, 12 Mar 2018 11:56:24 +0200 Subject: [PATCH] - remove wpautop filter at UM pages; --- includes/core/class-shortcodes.php | 12 ++++++++++++ includes/um-deprecated-functions.php | 16 ---------------- includes/um-short-functions.php | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/includes/core/class-shortcodes.php b/includes/core/class-shortcodes.php index c52b90f0..e923095c 100644 --- a/includes/core/class-shortcodes.php +++ b/includes/core/class-shortcodes.php @@ -23,6 +23,7 @@ if ( ! class_exists( 'Shortcodes' ) ) { add_filter( 'body_class', array( &$this, 'body_class' ), 0 ); + add_action( 'template_redirect', array( &$this, 'is_um_page' ) ); add_filter( 'um_shortcode_args_filter', array( &$this, 'display_logout_form' ), 99 ); add_filter( 'um_shortcode_args_filter', array( &$this, 'parse_shortcode_args' ), 99 ); @@ -176,6 +177,17 @@ if ( ! class_exists( 'Shortcodes' ) ) { return $content; } + + /** + * Remove wpautop filter for post content if it's UM core page + */ + function is_um_page() { + if ( is_ultimatemember() ) { + remove_filter( 'the_content', 'wpautop' ); + } + } + + /*** *** @extend body classes */ diff --git a/includes/um-deprecated-functions.php b/includes/um-deprecated-functions.php index 99176ce0..07b6d21a 100644 --- a/includes/um-deprecated-functions.php +++ b/includes/um-deprecated-functions.php @@ -174,22 +174,6 @@ function um_user_last_login_date( $user_id ) { } -/** - * Check if we are on UM page - * - * @deprecated 2.0 - * - * @return bool - */ -function is_ultimatemember() { - global $post; - if ( isset( $post->ID ) && in_array( $post->ID, UM()->config()->permalinks ) ) - return true; - - return false; -} - - /** * Is core URL * diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 0a145106..380b6f9a 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -2362,4 +2362,19 @@ function um_let_to_num( $v ) { } return $ret; +} + + +/** + * Check if we are on UM page + * + * @return bool + */ +function is_ultimatemember() { + global $post; + + if ( isset( $post->ID ) && in_array( $post->ID, UM()->config()->permalinks ) ) + return true; + + return false; } \ No newline at end of file