[Plugin: Content Warning] How-To: Change width and height
-
First off I would like to say that I will be adding this in an update as an option for the users, but for now this is a simple hack at the code you can use.
To start off, you should note that CWv2 utilizes the “Thickbox” API that’s built into WordPress. Therefore to show the window it uses AJAX calls within the function. For this how-to I’ll be using the /content-warning-v2/assets/wpcwv2.dev.js file as it’s not compressed. However for this alteration to work you need to use its contents to overwrite the wpcwv2.js file.
I honestly was going to separate it into parts, but it’s too simplified to do so, just open the dev.js file for the front-end and find the two functions show_tp() and show_denied_tb()
Change the height and width parameters for the ajax call, just take care not to change the other parameters.
Example (regular code):
function show_tb() { tb_show('Warning', cwv2Params.url + '?m=buildMessage&p=' + cwv2Params.postID + '&height=300&width=500&modal=true', false) }
Changing the height and width by adding 200:
function show_tb() { tb_show('Warning', cwv2Params.url + '?m=buildMessage&p=' + cwv2Params.postID + '&height=500&width=700&modal=true', false) }
Once you change the values remember to go into the wpcw.css file and change the #wpdoor_msg to a height of 100 less than what you changed it to within the javascript file. For instance our css would now read:
#wpdoor_msg{height: 400px;}
Hope that helps some of ya until I can get a chance to update the plugin, happy coding.
https://www.ads-software.com/extend/plugins/content-warning-v2/
- The topic ‘[Plugin: Content Warning] How-To: Change width and height’ is closed to new replies.