Guest User

Untitled

a guest
May 27th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. add_action( 'job_manager_job_dashboard_column_c27_listing_logo', function( $listing ) {
  2.  
  3. global $wp_filter;
  4.  
  5. if ( ! ( $listing = \MyListing\Src\Listing::get( $listing ) ) ) {
  6. return false;
  7. }
  8.  
  9. $images = get_post_meta( $listing->get_id(), '_job_gallery', true );
  10.  
  11. if ( is_array( $images ) && ! empty( $images ) ) {
  12. $image_url = $images[0];
  13. echo '<img src="' . esc_url( $image_url ) . '" width="32" height="32">';
  14. }
  15.  
  16. // Remove default Filters
  17. $filters =& $wp_filter['job_manager_job_dashboard_column_c27_listing_logo'];
  18.  
  19. if ( count( $filters->callbacks ) <= 1 ) {
  20. return null;
  21. }
  22.  
  23. $this_filter = true;
  24.  
  25. foreach ( $filters as $key => $value ) {
  26.  
  27. if ( $this_filter ) {
  28. $this_filter = false;
  29. continue;
  30. }
  31.  
  32. foreach( $value as $filter_name => $filter ) {
  33. remove_action( 'job_manager_job_dashboard_column_c27_listing_logo', $filter['function'] );
  34. }
  35. }
  36.  
  37. }, 1 );
Add Comment
Please, Sign In to add comment