Skip to content

Commit

Permalink
Revert WPML fix (bug fixed upstream)
Browse files Browse the repository at this point in the history
Introduced in #25; @tlebars confirmed fix no longer necessary in #153
  • Loading branch information
figureone committed Sep 6, 2024
1 parent 8a13c41 commit 0d8525a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/authorizer/options/class-public-access.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,7 @@ public function print_multiselect_auth_access_public_pages( $args = '' ) {
</optgroup>
<?php endforeach; ?>
<optgroup label="<?php esc_attr_e( 'Categories', 'authorizer' ); ?>">
<?php
// If sitepress-multilingual-cms plugin is enabled, temporarily disable
// its terms_clauses filter since it conflicts with the category handling.
if ( array_key_exists( 'sitepress', $GLOBALS ) && is_object( $GLOBALS['sitepress'] ) ) {
remove_filter( 'terms_clauses', array( $GLOBALS['sitepress'], 'terms_clauses' ) );
$categories = get_categories( array( 'hide_empty' => false ) );
add_filter( 'terms_clauses', array( $GLOBALS['sitepress'], 'terms_clauses' ) );
} else {
$categories = get_categories( array( 'hide_empty' => false ) );
}
foreach ( $categories as $category ) :
?>
<?php foreach ( get_categories( array( 'hide_empty' => false ) ) as $category ) : ?>
<option value="<?php echo esc_attr( 'cat_' . $category->slug ); ?>" <?php selected( in_array( 'cat_' . $category->slug, $auth_settings_option, true ) ); ?>><?php echo esc_html( $category->name ); ?></option>
<?php endforeach; ?>
</optgroup>
Expand Down

0 comments on commit 0d8525a

Please sign in to comment.