• I’m seeing this error on several pages within my installation. I looked at line 639

    Missing argument 2 for pfund_handle_title() in …wp-content/plugins/personal-fundraiser/includes/user.php on line 639

    Here is 632-645. I googled it trying to find an answer and see the same error on a few other sites using the plugin, too. Can you help me figure it out?

    * For personal fundraising campaigns, if the user just updated a campaign
     * title, pull the new value from the request; otherwise just use the
     * saved title.
     * @param string $atitle The current title.
     * @param int $post_id The post to display the title for.
     * @return string the title to display.
     */
    function pfund_handle_title( $atitle, $post_id ) {
        global $post;
    	if ( ! pfund_is_pfund_post( ) || $post_id != $post->ID ){
    		return $atitle;
    	}
    	return pfund_get_value( $_REQUEST, 'pfund-camp-title', $atitle );
    }

    http://wordpress.org/extend/plugins/personal-fundraiser/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author John Kleinschmidt

    (@johnkleinschmidt)

    It appears that you have another plugin or theme that is applying the “the_title” filter, but not passing the second parameter which is required:

    http://codex.wordpress.org/Plugin_API/Filter_Reference/the_title

    Its just a warning that you can ignore.

    Thread Starter Angie Meeker

    (@ameeker)

    I wondered if it was something along those lines. Is there anyway to make that warning go away? Users can see it from the front end.

    Plugin Author John Kleinschmidt

    (@johnkleinschmidt)

    In your wp-config.php file, change or set the following value:

    define('WP_DEBUG_DISPLAY', false);

    This disables the warnings from being displayed on screen

    OR

    define('WP_DEBUG', false);

    This turns off debugging in WordPress.

    Thread Starter Angie Meeker

    (@ameeker)

    Here is the fix for this error:

    Step 1 – Edit the Personal Fundraising plugin file /includes/user.php

    The code that’s breaking starts around line 639:

    function pfund_handle_title( $atitle, $post_id ) {
        global $post;
        if ( ! pfund_is_pfund_post( ) || $post_id != $post->ID ){
            return $atitle;
        }
        return pfund_get_value( $_REQUEST, 'pfund-camp-title', $atitle );
    }

    What we need to do is change the function just a little bit to accept an omitted $post_id:

    function pfund_handle_title( $atitle, $post_id = null ) {
        global $post;
        if ( null == $post_id || ! pfund_is_pfund_post( ) || $post_id != $post->ID ){
            return $atitle;
        }
        return pfund_get_value( $_REQUEST, 'pfund-camp-title', $atitle );
    }

    If no $post_id is supplied, we just return the title instead.

    (Supplied by Eric Mann at the wordpress.stackexchange.com forums

    Plugin Author John Kleinschmidt

    (@johnkleinschmidt)

    Thanks,

    I had already added that for the next release of the plugin, just to make sure it doesn’t happen with other plugins.

    Thread Starter Angie Meeker

    (@ameeker)

    John,

    Thanks again for everything today. I just installed the plugin Saturday morning, and am presenting it to the board tonight. It’s absolutely everything they asked for, but didn’t know they could really get.

    Thanks again!

    Angie

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Personal Fundraiser] Missing argument 2 for pfund_handle_title() in …user.php on line 639’ is closed to new replies.