Skip to content

Commit

Permalink
* Fix - Changed the admin class to only run admin_init when it is not…
Browse files Browse the repository at this point in the history
… an AJAX request.
  • Loading branch information
krugazul committed Sep 3, 2019
1 parent c5269d7 commit 245b96c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 3 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
## Changelog

### 1.2.3 - In Development
# Dev - Adding the .gitattributes file to remove unnecessary files from the WordPress version.
* Dev - Adding the .gitattributes file to remove unnecessary files from the WordPress version.
* Fix - Changed the admin class to only run admin_init when it is not an AJAX request.

### 1.2.2 - Aug 23, 2019
# Fix - Show banners from featured image on old non gutenberg posts correctly.
* Fix - Show banners from featured image on old non gutenberg posts correctly.

### 1.2.1 - Aug 6, 2019
* Fix - Fixed the post type archive titles
Expand Down
9 changes: 4 additions & 5 deletions classes/class-lsx-banners-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public function __construct() {

$this->set_vars();

add_action( 'admin_init', array( $this, 'admin_init' ) );
if ( ! wp_doing_ajax() ) {
add_action( 'admin_init', array( $this, 'admin_init' ) );
}
add_filter( 'cmb_meta_boxes', array( $this, 'metaboxes' ) );
add_filter( 'lsx_taxonomy_admin_taxonomies', array( $this, 'add_taxonomies' ), 10, 1 );

Expand All @@ -41,16 +43,13 @@ public function __construct() {
**/
public function admin_init() {
$this->taxonomy_admin = new LSX_Taxonomy_Admin();

$allowed_taxonomies = $this->get_allowed_taxonomies();

if ( is_array( $allowed_taxonomies ) ) {
foreach ( $allowed_taxonomies as $taxonomy ) {
//add_action( "{$taxonomy}_add_form_fields", array( $this, 'add_form_field' ),1 );
add_action( "{$taxonomy}_edit_form_fields", array( $this, 'add_form_field' ), 5, 1 );
}
}

}
add_action( 'create_term', array( $this, 'save_meta' ), 10, 2 );
add_action( 'edit_term', array( $this, 'save_meta' ), 10, 2 );

Expand Down
1 change: 0 additions & 1 deletion classes/class-lsx-banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public function __construct() {
require_once( LSX_BANNERS_PATH . 'classes/class-lsx-placeholders.php' );
add_action( 'init', array( $this, 'init_placeholders' ), 100 );
}

require_once( LSX_BANNERS_PATH . 'classes/class-lsx-banners-admin.php' );
if ( class_exists( 'LSX_Banners_Admin' ) ) {
$this->admin = new LSX_Banners_Admin();
Expand Down

0 comments on commit 245b96c

Please sign in to comment.