{"id":1740,"date":"2019-05-19T08:29:49","date_gmt":"2019-05-19T08:29:49","guid":{"rendered":"https:\/\/redirection.me\/?page_id=1740"},"modified":"2019-11-30T14:25:13","modified_gmt":"2019-11-30T14:25:13","slug":"php-api","status":"publish","type":"page","link":"https:\/\/redirection.me\/developer\/php-api\/","title":{"rendered":"PHP API"},"content":{"rendered":"\n<p>Although the <a href=\"https:\/\/redirection.me\/developer\/rest-api\/\">REST API<\/a> is the preferred method of accessing Redirection, it is also possible to call Redirection functions directly using PHP.<\/p>\n\n\n\n<p>It should be noted that this API is subject to change. Use at your own risk.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating Redirects<\/h3>\n\n\n\n<p>The key to creating a redirect is with <code>Red_Item::create()<\/code>. It is passed an array of data that determines the redirect.<\/p>\n\n\n\n<p>Note the array will be sanitized with <code>Red_Item_Sanitize<\/code>.<\/p>\n\n\n\n<p>See the <a href=\"https:\/\/redirection.me\/developer\/rest-api\/\">REST API documentation<\/a> for details of expected data formats.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Although the REST API is the preferred method of accessing Redirection, it is also possible to call Redirection functions directly using PHP. It should be noted that this API is subject to change. Use at your own risk. Creating Redirects The key to creating a redirect is with Red_Item::create(). It is passed an array of&hellip; <a class=\"more-link\" href=\"https:\/\/redirection.me\/developer\/php-api\/\">Continue reading <span class=\"screen-reader-text\">PHP API<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1734,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1740","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/pages\/1740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/comments?post=1740"}],"version-history":[{"count":4,"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/pages\/1740\/revisions"}],"predecessor-version":[{"id":2215,"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/pages\/1740\/revisions\/2215"}],"up":[{"embeddable":true,"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/pages\/1734"}],"wp:attachment":[{"href":"https:\/\/redirection.me\/wp-json\/wp\/v2\/media?parent=1740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}