Making WordPress.org

Changeset 774


Ignore:
Timestamp:
07/30/2014 10:09:00 PM (12 years ago)
Author:
coffee2code
Message:

Handbook plugin: remove P2 Unresolved Posts action links (e.g. "Flag Unresolved") from handbook pages. Fixes #436

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/handbook.php

    r772 r774  
    7373                add_action( 'widgets_init',                       array( $this, 'handbook_sidebar' ), 11 ); // After P2
    7474                add_action( 'wporg_email_changes_for_post_types', array( $this, 'wporg_email_changes_for_post_types' ) );
     75                add_action( 'p2_action_links',                    array( $this, 'disable_p2_resolved_posts_action_links' ) );
    7576        }
    7677
     
    166167                return $post_types;
    167168        }
     169
     170        /**
     171         * Disable the P2 Resolved Posts plugin's action links (e.g. "Flag Unresolved"),
     172         * if that plugin is active.
     173         */
     174        function disable_p2_resolved_posts_action_links() {
     175                if ( ( $this->post_type == get_post_type() ) && class_exists( 'P2_Resolved_Posts' ) && is_object( P2_Resolved_Posts::$instance ) ) {
     176                        remove_filter( 'p2_action_links', array( P2_Resolved_Posts::$instance, 'p2_action_links' ), 100 );
     177                }
     178        }
     179
    168180}
Note: See TracChangeset for help on using the changeset viewer.