SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Plugin does not work after WP upgraded to 3.0

    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.
    PHP Code:
    add_action('activate_'.$this->tmh_pi_path, array(&$this'tmhpiActivate')); 
    And none of other calls are working as well
    PHP Code:
    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
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry guys,

    The problem was not because of the function add_action. An if condition check was logically wrong or kind of stupid. They have a if condition like this in the plugin :
    PHP Code:
    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:

    Code:
    /wordpress/wp-admin/post.php?action=edit&post=1
    And Wordpress 3.0 does have the link while editing the post like this:
    Code:
    /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.

    Edit:
    Now I checked the condition like this:
    PHP Code:
    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
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •