Skip to content

Commit

Permalink
Merge pull request #46 from BCcampus/button-fix
Browse files Browse the repository at this point in the history
resolve not to show on add glossary term screen
  • Loading branch information
alex-418 authored Aug 9, 2018
2 parents c2dbb4c + d631576 commit 4c5f428
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inc/shortcodes/glossary/class-glossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,13 @@ function glossaryButton() {
// glossary buttons means less chance of needing to untangle the labyrinth
global $typenow;

if ( empty( $typenow ) && ! empty( $_GET['post'] ) ) {
$post = get_post( $_GET['post'] );
if ( empty( $typenow ) && ! empty( $_GET['post'] ) && 'edit' === $_GET['action'] ) {
$post = get_post( $_GET['post'] );
$typenow = $post->post_type;
} elseif ( ! empty( $_GET['post_type'] ) ) {
$typenow = $_GET['post_type'];
}

if ( 'glossary' !== $typenow ) {
add_filter(
'mce_buttons_3', [
Expand Down

0 comments on commit 4c5f428

Please sign in to comment.