thank you.
I had seen this. But I had trouble using it. Information was not enough for a beginner 🙂
I want to use php api and Red_Item::create().
Is it possible to show how to work with this class with an example ? What items will be included in Red_Item_Sanitize?
Thank you very much.
I don’t currently have any examples. You will need to look at the code in redirect-sanitizer.php and see what data is used
I Tested this :
$red_arr = array(
'title' => 'test',
'group_id' => 1,
'source' => 'https://domain.com/google',
'url' => 'https://google.com'
);
include plugin_dir_path( __DIR__ ).'Redirection/models/redirect.php';
$redirect = new Red_Item();
$reds = $redirect->create($red_arr);
But Not working!!!
I’m probably having a problem in the Array structure.
Alert message : The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.
anyone help…
As I said there is no example and you will need to figure things out from the code. You should call Red_Item::create instead of creating an object.
print_r( $reds ); will show you what the problem is.