plugin development - Can calling wp_enqueue_style in wp_iframe apply the stylesheet to everything not just the iframe?

I am currently discovering a problem where a wp_enqueue_style call in wp_iframe is causing my page to break due to the C

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

wp_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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745445807a4628041.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信