Hardening uploads folder in IIS breaks images

I don’t know if that is the right way but the last time I worked with IIS, I used this code to prevent the loading of an PHP script in the uploads folder. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <location path=”wp-content/uploads”> <system.webServer> <security> <requestFiltering> <fileExtensions> <add fileExtension=”.php” allowed=”false” /> </fileExtensions> </requestFiltering> </security> </system.webServer> </location> </configuration> If you … Read more

Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]

Let’s unwrap it to more readable form: <?php if ( ! empty( get_the_author_meta( ‘facebook’, $part_cur_auth_obj->ID ) ) ) { ?><a href=”https://wordpress.stackexchange.com/questions/305172/<?php echo get_the_author_meta(“facebook’, $part_cur_auth_obj->ID);?>”> <i class=”fab fa-facebook-f”></i> </a><?php}?> End the last line is a problem. There are no spaces around curly bracket and it causes the error. Just change it to <?php } ?> and … Read more

Add post with approval by the admin

Set New User Default Role to Contributor. Change user role of existing users as well, if needed. UPDATE Add this to your functions.php file. It’ll allow your contributor and author users to add WooCommerce products. And then set default user role to contributor as I suggested before. function wpse_306836_wc_custom_permission( $args, $post_type ) { if ( … Read more

How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286

Replace ‘call_user_func_array’ with name of the function to be called to output the page content. add_action(‘admin_menu’, ‘personalised_menu’); function personalised_menu() { add_menu_page( ‘Page Title’, ‘Blog’, ‘edit_posts’, ‘menu_slug’, ‘display_main_page’, ‘dashicons-welcome-write-blog’ ); add_submenu_page( ‘menu_slug’, ‘Add New Page’, ‘Add New’, ‘edit_posts’,’add_new_page’, ‘display_secondary_page’ ); } function display_main_page() { echo ‘Content of “Page Title”‘; } function display_secondary_page() { echo ‘Content of … Read more