Image Crop/Resize Function/Code Sinppet/Plugin to adjust/crop images during upload

-= 1 =- This is untested and might not work with your theme if it’s using a custom function to upload the actual images, but I would add the size you want using add_image_size( ‘profile_photo’, $width, $height, array( ‘center’, ‘middle’ ) ); to your functions.php file. Then you can retrieve the image using wp_get_attachment_image_src() passing … Read more

Can installing a plugin delete an entire theme directory?

Do WordPress plugins have permissions to delete entire directories? (it’s a Linux based host) WordPress plugins have permissions to do anything WordPress itself can do. It’s all just code. There’s no permissions model or sandboxing of any kind with plugins. Plugins and themes can do anything that PHP on your system can do. Is there … Read more

Woocommerce different URL for every table placed in the restaurant

I don’t have a WooCommerce currently to test this out on, so it’s very rough and ready, and may not even work… But, I think the logic is fairly sound. Give this a go: // Store session value for table number add_action(‘init’, ‘store_table_number’); function store_table_number() { if( $_GET[‘dining’] ) { global $tableNo; $tableNo = array( … Read more

Use external link in the add sub menu

Last argument of function add_submenu_page is the name of the function to call when display the content of the page. As described here: http://codex.wordpress.org/Function_Reference/add_submenu_page The right use is: add_submenu_page( ‘antify’, ‘Plugins’, ‘Plugins’, ‘manage_options’, ‘plugins’, ‘my_function’ ); function my_function(){ echo ‘hello’; } If you want a separate file you can do this add_submenu_page( ‘antify’, ‘Plugins’, ‘Plugins’, … Read more