Initially I was using active_callback
to make my Customizer controls contextual in nature, and was satisfied with the kind product I had with it. But then I cam across this article about Content-aware previews in Customizer. It is awesome.
In that article, the author has used his own plugin to get the page value. I got everything from the JavaScript enqueued for the controls and the previews, what I didn't get is; what could be the page value for a post or a page or a custom post type here.
$page = Login_Designer()->get_login_designer_page();
Is anyone doing something similar with Customizer? Please share how this can be doable with the different page types.
Initially I was using active_callback
to make my Customizer controls contextual in nature, and was satisfied with the kind product I had with it. But then I cam across this article about Content-aware previews in Customizer. It is awesome.
In that article, the author has used his own plugin to get the page value. I got everything from the JavaScript enqueued for the controls and the previews, what I didn't get is; what could be the page value for a post or a page or a custom post type here.
$page = Login_Designer()->get_login_designer_page();
Is anyone doing something similar with Customizer? Please share how this can be doable with the different page types.
Share Improve this question asked Aug 5, 2018 at 8:20 BheemsenBheemsen 7710 bronze badges1 Answer
Reset to default 1Since the code is using get_permalink( $page )
, I would guess that $page holds an ID.
https://developer.wordpress/reference/functions/get_permalink/
In my opinion, it's not always a good thing to switch the preview to another page for the user.