Skip to content

Commit

Permalink
inject tags button
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwach committed Jul 17, 2015
1 parent 6482497 commit 789aa14
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/hooks-wp-fee.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ function cacsp_wp_fee_enqueue_scripts() {
}
add_action( 'wp_enqueue_scripts', 'cacsp_wp_fee_enqueue_scripts', 999 );

/**
* Add button to WP FEE's toolbar
*
* @param object $post The WordPress post object
*/
function cacsp_wp_fee_tax_buttons( $post ) {
if ( ! cacsp_is_page() ) {
return;
}

if ( in_array( 'cacsp_paper_tag', get_object_taxonomies( $post ) ) ) { ?>
<button class="button button-large fee-button-cacsp_paper_tag"><div class="dashicons dashicons-tag dashicons-cacsp_paper_tag"></div></button>
<?php }
}
add_action( 'fee_tax_buttons', 'cacsp_wp_fee_tax_buttons' );

/**
* Prevent WP FEE from loading
*
Expand Down

6 comments on commit 789aa14

@christianwach
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're going to have to add our own Tags and Groups buttons and provide the functionality for them ourselves. WP FEE offers no such functionality - it simply looks like unfinished code, and indeed the master branch of the Github repo seems to have removed the toolbar altogether.

I've hacked it such that we can actually do so with the included lib. FWIW, I use a modified version of 1.0.4 with the same class FEE as the one in our lib.

@christianwach
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've hacked it such that we can actually do so with the included lib.

See 6482497 for the action I added.

@boonebgorges
Copy link
Member

@boonebgorges boonebgorges commented on 789aa14 Jul 17, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r-a-y
Copy link
Member

@r-a-y r-a-y commented on 789aa14 Jul 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christianwach - Regarding the tags button, did this button work when you implemented this?

I ask because I've changed how we're working with FEE (see #10). I tried out the button before commit 5635e64 and the button didn't work when I clicked on it. Just wanted to make sure I didn't break anything prior to the latest changes.

@christianwach
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r-a-y No, the button isn't working, just visible. Committed this so that work could begin on making it functional.

@r-a-y
Copy link
Member

@r-a-y r-a-y commented on 789aa14 Jul 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for verifying, Christian!

Please sign in to comment.