admin管理员组文章数量:1425746
I am currently discovering a problem where a wp_enqueue_style
call in wp_iframe
is causing my page to break due to the CSS overwriting some of the parent CSS outside of the iframe.
add_action('wp_ajax_getImageEditor', 'exampleCall');
function exampleCall(){
wp_iframe('frameInfo');
}
function frameInfo(){
wp_register_style('fabriccss', plugins_url('/fabricJS.css', __FILE__));
wp_enqueue_style('fabriccss');
echo "HELLO";
}
Included are two pictures. The first one shows what it looks like if you run the above code as normal. .png
The second image shows what happens if you comment out wp_enqueue_style('fabriccss');
.
Comparing the two, you can see that the title and button CSS have changed even though the only iframe is in the middle.
Any ideas on how to fix this?
I am currently discovering a problem where a wp_enqueue_style
call in wp_iframe
is causing my page to break due to the CSS overwriting some of the parent CSS outside of the iframe.
add_action('wp_ajax_getImageEditor', 'exampleCall');
function exampleCall(){
wp_iframe('frameInfo');
}
function frameInfo(){
wp_register_style('fabriccss', plugins_url('/fabricJS.css', __FILE__));
wp_enqueue_style('fabriccss');
echo "HELLO";
}
Included are two pictures. The first one shows what it looks like if you run the above code as normal. https://s27.postimg/mqiidwtqb/stack_Question1.png
The second image shows what happens if you comment out wp_enqueue_style('fabriccss');
.
Comparing the two, you can see that the title and button CSS have changed even though the only iframe is in the middle.
Any ideas on how to fix this?
Share Improve this question edited Jun 15, 2020 at 8:21 CommunityBot 1 asked Aug 17, 2015 at 20:40 csvehlacsvehla 112 bronze badges1 Answer
Reset to default 1wp_iframe doesn't actually create an iframe it just applies it in a special div. Therefore, my way around this is just scoping my CSS to be specific to what I want to display with my added CSS.
本文标签:
版权声明:本文标题:plugin development - Can calling wp_enqueue_style in wp_iframe apply the stylesheet to everything not just the iframe? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745445806a2658657.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论