Title: phpwppro's Replies | WordPress.org

---

# phpwppro

  [  ](https://wordpress.org/support/users/phpwppro/)

 *   [Profile](https://wordpress.org/support/users/phpwppro/)
 *   [Topics Started](https://wordpress.org/support/users/phpwppro/topics/)
 *   [Replies Created](https://wordpress.org/support/users/phpwppro/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/phpwppro/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/phpwppro/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/phpwppro/engagements/)
 *   [Favorites](https://wordpress.org/support/users/phpwppro/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002584)
 * I have enough space on server..thanks for your help..!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002565)
 * Still no lucks..!
    I am just confused why its working on localhost and neither
   working on host? What issue can be?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002544)
 * Yes its working perfectly on localhost but when i upload it to my host which 
   is 1&1 host then its not working..!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002538)
 * I have enabled the WP_DEBUG mode but when i activate it, its not showing any 
   error neither in error log nor debug.log file.. I am using below constant to 
   debug:
    define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’,
   true); define(‘SCRIPT_DEBUG’, true);
 * but no luck 🙁
 * any ideas!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002525)
 * Nope i have not enabled WP_DEBUG mode yet…! but i have written error_log(‘Redirect
   Hook’) into function redirect_after_trashing to know wordpress is calling this
   hook or not but whenever i do delete the hook, its not calling the my custom 
   hook..!!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Adminimize] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post-1/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post-1/#post-7002452)
 * Hi thanks for prompt reply
    Yes, here is the code.. <?php /* * Plugin Name: Redirect
   on deleting post type friend_request */ function redirect_after_trashing( $post_id){
 *  $the_post = get_post( $post_id );
 *  // get the deleted post types
    $deleted_post_type = $the_post->post_type;
 *  if( $deleted_post_type == ‘friend_request’ ) {
    wp_redirect( home_url() ); exit();}}
   add_action( ‘trashed_post’, ‘redirect_after_trashing’, 10, 1 );
 * What’s wrong with the code?
 * Thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Custom Post Type UI] Redirect after deleting post](https://wordpress.org/support/topic/redirect-after-deleting-post/)
 *  Thread Starter [phpwppro](https://wordpress.org/support/users/phpwppro/)
 * (@phpwppro)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/redirect-after-deleting-post/#post-6998218)
 * Hi, thanks for your reply
    I tried your code but its not working 🙁 what else
   to do?
 * Thanks

Viewing 7 replies - 1 through 7 (of 7 total)