Making WordPress.org


Ignore:
Timestamp:
06/17/2014 12:38:46 AM (10 years ago)
Author:
coffee2code
Message:

Handbook plugin: prevent pre-existing PHP warnings

  • Explicitly declare array values before use (and check value before use in str_replace())
  • Explicitly declare statically referenced methods as static
  • Add instance arg to widgets()
File:
1 edited

Legend:

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

    r705 r707  
    77class WPorg_Handbook_Email_Post_Changes {
    88
    9     function init() {
     9    public static function init() {
    1010        add_action( 'widgets_init', array( __CLASS__, 'handbook_sidebar' ), 11 ); // After P2
    1111        add_filter( 'email_post_changes_emails', array( __CLASS__, 'email_post_changes_emails' ), 10, 3 );
     
    1414    }
    1515
    16     function handbook_sidebar() {
    17 
     16    public static function handbook_sidebar() {
    1817        require_once dirname( __FILE__ ) . '/widgets.php';
    1918        register_widget( 'WPorg_Handbook_Widget' );
    2019    }
    2120
    22     function option_email_post_changes( $values ) {
     21    public static function option_email_post_changes( $values ) {
    2322        $values['post_types'] = apply_filters( 'wporg_email_changes_for_post_types', $values['post_types'] );
    2423        return $values;
    2524    }
    2625
    27     function email_post_changes_emails( $emails, $post_before, $post_after ) {
     26    public static function email_post_changes_emails( $emails, $post_before, $post_after ) {
    2827        $post = get_post( $post_after );
    2928        $users = get_post_meta( $post->ID, '_wporg_watchlist', true );
     
    3837    }
    3938
    40     function update_watchlist() {
     39    public static function update_watchlist() {
    4140        $post_id = absint( $_GET['post_id'] );
    4241        if ( ! $post_id || ! $post = get_post( $post_id ) ) {
Note: See TracChangeset for help on using the changeset viewer.