0

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.

1

Since the code is using get_permalink( $page ), I would guess that $page holds an ID.

https://developer.wordpress.org/reference/functions/get_permalink/

In my opinion, it's not always a good thing to switch the preview to another page for the user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.