Skip to content

Commit

Permalink
MTG fix for existing taxonomies sometimes not loading
Browse files Browse the repository at this point in the history
Fixes #93
  • Loading branch information
JiveDig committed Dec 12, 2024
1 parent c5e12eb commit 0987944
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/fields/wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @since 2.21.0
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @param array $field The existing field array.
*
Expand All @@ -41,14 +41,15 @@ function mai_grid_load_post_type_field( $field ) {
*
* @link https://github.com/maithemewp/mai-engine/issues/93
*
* @since TBD
* @since ?
*
* @param array $field The existing field array.
*
* @return array
*/
function mai_grid_prepare_tax_taxonomy_field( $field ) {
if ( ! ( is_admin() && wp_doing_ajax() ) ) {
// Bail if not in admin. No AJAX check here because we need this on page load.
if ( ! is_admin() ) {
return $field;
}

Expand All @@ -69,7 +70,7 @@ function mai_grid_prepare_tax_taxonomy_field( $field ) {
*
* @since 2.21.0
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @param array $field The existing field array.
*
Expand Down Expand Up @@ -99,7 +100,7 @@ function mai_grid_load_tax_taxonomy_field( $field ) {
*
* @since 0.3.3
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @param array $field The ACF field array.
*
Expand Down Expand Up @@ -138,7 +139,7 @@ function mai_acf_prepare_terms( $field ) {
*
* @since 0.1.0
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @param array $field The ACF field array.
*
Expand Down Expand Up @@ -166,7 +167,7 @@ function mai_acf_load_terms( $field ) {
*
* @since 0.1.0
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @param array $args Field args.
*
Expand Down Expand Up @@ -204,7 +205,7 @@ function mai_acf_get_post_parents( $args ) {
*
* @since 2.15.0
* @since 2.25.6 Added admin check.
* @since TBD Added ajax check.
* @since 2.35.0 Added ajax check.
*
* @link https://www.powderkegwebdesign.com/fantastic-way-allow-searching-id-advanced-custom-fields-objects/
*
Expand Down

0 comments on commit 0987944

Please sign in to comment.