On publish redirect to a specific page.
« on: May 06, 2020, 02:54:53 PM »
hi, please  some idea where i can change that on a succefull published ads then redirec to a especific page, not default category.


*

MB Themes

Re: On publish redirect to a specific page.
« Reply #1 on: May 07, 2020, 06:58:46 AM »
@Matias
Code: [Select]
function abc() {
  Header('Location: https://myurl.com');
}

osc_add_hook('posted_item', 'abc');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: On publish redirect to a specific page.
« Reply #2 on: May 14, 2020, 12:31:04 AM »
thanks for your help, y try these code on functions.php but not redirect.   :-\

Re: On publish redirect to a specific page.
« Reply #3 on: May 14, 2020, 04:00:11 AM »
 :D i got


Code: [Select]
function my_function_after_post($item){
                $itemId = $item['pk_i_id']; //get item id from $item variable that will contain all the date of the item
                $goweb="https://abc.com";
                //get my field data to insert in database for my plugin
                header("Location: " . $goweb); //redirect on post page
                exit(); //exit
            }
osc_add_hook('posted_item', 'my_function_after_post');

*

MB Themes

Re: On publish redirect to a specific page.
« Reply #4 on: May 15, 2020, 01:30:26 PM »
@Matias Torres Vsz
Just make sure it does not brake other functions that are executed after item is posted (plugins data)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots