Skip to content
Permalink
Browse files

Change `the_content` priority for other 3rd party plugins

  • Loading branch information...
KingYes committed Sep 22, 2016
1 parent adc81fe commit 97dec6ef1ab604947c646e4ade39381244adf420
Showing with 11 additions and 2 deletions.
  1. +11 −2 includes/frontend.php
@@ -9,22 +9,24 @@ class Frontend {
private $_enqueue_google_early_access_fonts = [];
private $_column_widths = [];
private $_is_frontend_mode = false;
/**
* @var Stylesheet
*/
private $stylesheet;
public function init() {
if ( is_admin() || Plugin::instance()->editor->is_edit_mode() || Plugin::instance()->preview->is_preview_mode() ) {
if ( Plugin::instance()->editor->is_edit_mode() || Plugin::instance()->preview->is_preview_mode() ) {
return;
}
$this->_is_frontend_mode = true;
$this->_init_stylesheet();
add_action( 'wp_head', [ $this, 'print_css' ] );
add_filter( 'body_class', [ $this, 'body_class' ] );
add_filter( 'the_content', [ $this, 'apply_builder_in_content' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ] );
@@ -363,6 +365,9 @@ protected function _parse_schemes_css_code() {
}
public function apply_builder_in_content( $content ) {
if ( ! $this->_is_frontend_mode )
return $content;
$post_id = get_the_ID();
if ( post_password_required( $post_id ) )
return $content;
@@ -403,6 +408,10 @@ function add_menu_in_admin_bar( \WP_Admin_Bar $wp_admin_bar ) {
}
public function __construct() {
if ( is_admin() )
return;
add_action( 'template_redirect', [ $this, 'init' ] );
add_filter( 'the_content', [ $this, 'apply_builder_in_content' ] );
}
}

0 comments on commit 97dec6e

Please sign in to comment.
You can’t perform that action at this time.