Guest User

Untitled

a guest
Nov 17th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php // don't include this line in your functions.php, since it already starts with it.
  2.  
  3. function _remove_team_members_si_toggl_import_entries( $time_entries = array() ) {
  4. foreach ( $time_entries as $key => $time_entry ) {
  5. if ( isset( $time_entry->tags ) ) { // it's likely not
  6. $tag_array = json_decode( $time_entry->tags );
  7. if ( ! in_array( 'filterTAG', $tag_array ) ) { // filterTAG is the tag you only want to import
  8. unset( $time_entries[$key] ); // remove
  9. }
  10. }
  11. }
  12. return $time_entries;
  13. }
  14. add_filter( 'si_toggl_import_entries', '_remove_team_members_si_toggl_import_entries' );
Add Comment
Please, Sign In to add comment