Restrict Image Sizes and Dimensions when Uploading via the WP Mobile App

Try this code in function.php I hope this help. add_action( ‘rest_api_init’, ‘set_image_dimension_limit’ ); function set_image_dimension_limit() { add_filter( ‘wp_handle_upload_prefilter’, function( $file ) { $mimes = array( ‘image/jpeg’, ‘image/png’, ‘image/gif’ ); if( !in_array( $file[‘type’], $mimes ) ) return $file; $img = getimagesize( $file[‘tmp_name’] ); $maximum = array( ‘width’ => 500, ‘height’ => 700 ); if ( $img[0] … Read more

Using Conditional Tags to restrict something to 1 user?

I don’t know the plugin, but with a rapid eye on it, it seems that what you want is not, but you can rely on widget_content filter fired by the plugin you are using. So, in your theme function.php put: if ( function_exists(‘widget_logic_redirected_callback’) ) add_filter(‘widget_content’, ‘my_widget_for_user’, 10, 2); function my_widget_for_users ($widget_content, $widget_id) { $allowed_users = … Read more

Premium Members Section of website

The best way to have complete control is to use conditionals in your templates. Look at current_user_can() for specific permissions – or if its simply for being logged in you could use is_user_logged_in(). eg: if( is_user_logged_in() ){ // echo product details }else{ //echo login form and message } That we you have complete control over … Read more