Skip to content

Commit

Permalink
Tweak! - Added compatibility for NextGen gallery plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
KingYes committed Jul 25, 2016
1 parent 1e2c64c commit a669c7b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
22 changes: 22 additions & 0 deletions includes/compatibility.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
namespace Elementor;

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

class Compatibility {

public static function register_actions() {
add_action( 'init', [ __CLASS__, 'init' ] );
}

public static function init() {
// Hotfix for NextGEN Gallery plugin
if ( defined( 'NGG_PLUGIN_VERSION' ) ) {
add_filter( 'elementor/utils/get_edit_link', function( $edit_link ) {
return add_query_arg( 'display_gallery_iframe', '', $edit_link );
} );
}
}
}

Compatibility::register_actions();
1 change: 1 addition & 0 deletions includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private function _includes() {
include( ELEMENTOR_PATH . 'includes/utils.php' );
include( ELEMENTOR_PATH . 'includes/user.php' );
include( ELEMENTOR_PATH . 'includes/fonts.php' );
include( ELEMENTOR_PATH . 'includes/compatibility.php' );

include( ELEMENTOR_PATH . 'includes/db.php' );
include( ELEMENTOR_PATH . 'includes/controls-manager.php' );
Expand Down
2 changes: 1 addition & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static function is_development_mode() {
}

public static function get_edit_link( $post_id = 0 ) {
return add_query_arg( 'elementor', '', get_permalink( $post_id ) );
return apply_filters( 'elementor/utils/get_edit_link', add_query_arg( 'elementor', '', get_permalink( $post_id ) ), $post_id );
}

public static function is_post_type_support( $post_id = 0 ) {
Expand Down

0 comments on commit a669c7b

Please sign in to comment.