• Hi WP Gurus,

    There had used a simple image posting plugin which displays the form below the post/page add/edit form in admin and uploads the images to the specified path and inserts a custom meta to the table. But all of a sudden when I upgraded to WP 3.0 then it stopped working. That means there is no form displayed in the post/page add/edit form in admin even the plugin is active.

    Though I am not expert in WP, but when I tried to troubleshoot by seeing all the function calls in the plugin, the following function call add_action() does not call the specified member function.

    add_action('activate_'.$this->tmh_pi_path, array(&$this, 'tmhpiActivate'));

    And none of other calls are working as well

    add_action('edit_form_advanced', array(&$this, 'tmhpiCustomFields'));
    add_action('edit_page_form', array(&$this, 'tmhpiCustomFields'));
    add_action('edit_post', array(&$this, 'tmhpiMetaboxHandle'));

    It was working perfecting fine before with 3.0 (with 2.9.x) but when I upgraded WP to 3.0 then suddenly it does not show a form field in below the post form in admin.

    Can anyone point out me what is missing? I tried to look in the WP codex page but I don’t see any major changes in that function. Is there anything such big change in add_action() function.

    Thank you all in advance.

    Regards
    Raju

Viewing 2 replies - 1 through 2 (of 2 total)
  • It seems like WP3 has stopped plugins appearing on the upload page. This has affected other plugins like Flexible Upload and is a big pain. Sorry i have no answers

    Thread Starter Raju Gautam

    (@rajug)

    Sorry guys,

    The problem was not because of the function add_action but it seems it is obvious that the problem is again because of WordPress upgrade to 3.0.

    An if condition check was logically wrong or kind of stupid. They have a if condition like this in the plugin :

    if ( strpos($_SERVER['REQUEST_URI'], 'post.php?action=edit') !== false  ) {
        // show the image upload field.
    }

    The condition was true in prior versions because in the URL while editing the post looks like this:

    /wordpress/wp-admin/post.php?action=edit&post=1

    And WordPress 3.0 does have the link while editing the post like this:
    /wordpress/wp-admin/post.php?post=1&action=edit

    and WordPress 3.0 does not display the form because the condition always gets failed.

    Really annoying and frustrating situation I had since last week.

    Really annoying and frustrating situation I had since last week.

    Now I checked the condition like this:

    if ( $_GET['action'] == 'edit' ) {
        // show the image upload field.
    }

    Can anyone point out me if I am doing something wrong? Though it is working now but I am not sure that I can use $_GET superglobal directly inside the function/method of a class in the plugin.

    With Regards
    Raju

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin does not work after WP upgraded to 3.0’ is closed to new replies.