WordPress.org

Ready to get started?Download WordPress

Forums

Personal Fundraiser
Missing argument 2 for pfund_handle_title() in ...user.php on line 639 (7 posts)

  1. AMEEKER
    Member
    Posted 2 years ago #

    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/

  2. John Kleinschmidt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. AMEEKER
    Member
    Posted 2 years ago #

    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.

  4. John Kleinschmidt
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  5. AMEEKER
    Member
    Posted 2 years ago #

    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

  6. John Kleinschmidt
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks,

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

  7. AMEEKER
    Member
    Posted 2 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic