Need set value if post is spam or not on hook after post ad
« on: August 17, 2024, 08:28:25 AM »
May be this hook is used after post ad
osc_add_hook('posted_item', 'check_item_spam');

function check_item_spam($xyz) {
   
    if ($is_spam) {
    // Code to be executed if the condition is true
    Set item value to spam ( ad not live)
} else {
    // Code to be executed if the condition is false.
  Set value is not spam(ad will live on site)
}
   
}

Need help, how to set based on this example. Set value if item is spam of posted item.

Marked as best answer by bhagwati.suthar on August 19, 2024, 02:46:28 PM
*

MB Themes

Re: Need set value if post is spam or not on hook after post ad
« Reply #1 on: August 19, 2024, 10:34:35 AM »
You can use itemactions

Code: [Select]
$manager = new ItemActions(false);
$manager->spam($item_id, true);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Need set value if post is spam or not on hook after post ad
« Reply #2 on: August 19, 2024, 02:46:52 PM »
Thankyou so much, working.
« Last Edit: August 19, 2024, 03:24:23 PM by Bhagwati Suthar »