Posts: 116
Threads: 38
Joined: Sep 2017
Hi
Want to make small plugin so that when the user saves a new page I am able to call a function to grab the url of the newly made page.
Thought that changedata-save would be ideal but not sure I'm using it correctly.
Any ideas how I would achieve this please
Posts: 538
Threads: 12
Joined: May 2013
If you don't want to interfere with the saving process use changedata-aftersave
Posts: 3,491
Threads: 106
Joined: Mar 2010
You can use global variable $url to get the page slug, then function find_url to obtain the full URL.
But it might be better to use hook changedata-aftersave and check global var $status just in case there was some problem when saving.
Posts: 116
Threads: 38
Joined: Sep 2017
2018-09-21, 18:20:04
(This post was last modified: 2018-09-21, 18:35:33 by craiga.)
(2018-09-21, 02:02:49)Carlos Wrote: You can use global variable $url to get the page slug, then function find_url to obtain the full URL.
But it might be better to use hook changedata-aftersave and check global var $status just in case there was some problem when saving.
Just tried the Global url and it works a real treat . . . . Thanks again, really appreciated