admin管理员组文章数量:1130349
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.
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.
本文标签: theme developmentDoing contextaware previews in the WordPress Customizer
版权声明:本文标题:theme development - Doing context-aware previews in the WordPress Customizer 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749023716a2304771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论