{"id":978,"date":"2018-05-21T11:59:24","date_gmt":"2018-05-21T11:59:24","guid":{"rendered":"http:\/\/dijitalturk.com\/veysel\/?p=978"},"modified":"2018-05-21T11:59:24","modified_gmt":"2018-05-21T11:59:24","slug":"minimum-attachment-size-control","status":"publish","type":"post","link":"https:\/\/dijitalturk.com\/veysel\/minimum-attachment-size-control\/","title":{"rendered":"Minimum attachment size control"},"content":{"rendered":"<p>If you want to set minimum attachment size control to sys_attachment table you can create business rule to sys_attachment table as you can below. (T\u00fcrk\u00e7e anlat\u0131m mevcuttur).<\/p>\n<p><!--more--><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">var size = 10240;\r\nif(current.size_bytes &lt; size){\r\n  \r\n  if( current.content_type=='image\/png' || current.content_type=='image\/jpeg' || current.content_type=='image\/gif'  ){\r\n    gs.addInfoMessage( \" Eklenti boyutu izin verilen s\u0131n\u0131r\u0131n alt\u0131ndad\u0131r. ( \" + size + \" ) \" );\r\n    current.setAbortAction(true);\r\n  }\r\n  \r\n  \r\n}\r\n<\/pre>\n<p>This code block will check attachment size and attachment type (jpeg,png,gif)<\/p>\n<p>You can discart all image resized by your selection.<\/p>\n<p>TR : Bu kod blo\u011fu sayesinde belirledi\u011finiz ebatlar\u0131n alt\u0131ndaki g\u00f6rseller attachment tablosuna eklemeyecektir. Bu kodu sys_attachment tablosunda business rule olarak eklemeniz yeterlidir.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1.png\" target=\"_blank\" rel=\"noopener noreferrer nofollow\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" class=\"aligncenter size-large wp-image-979 lazyload\" data-src=\"http:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1-600x370.png\" alt=\"\" width=\"600\" height=\"370\" data-srcset=\"https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1-600x370.png 600w, https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1-300x185.png 300w, https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1-768x473.png 768w, https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2018\/05\/Screenshot_1.png 1199w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/370;\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to set minimum attachment size control to sys_attachment table you can create business rule to sys_attachment table [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[185],"tags":[285,286,284],"class_list":["post-978","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-service-now","tag-business-rule","tag-minimum-dosya-boyutu","tag-sys_attachment"],"uagb_featured_image_src":{"full":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon.png",256,256,false],"thumbnail":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon-150x150.png",150,150,true],"medium":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon-190x190.png",190,190,true],"medium_large":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon.png",256,256,false],"large":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon.png",256,256,false],"1536x1536":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon.png",256,256,false],"2048x2048":["https:\/\/dijitalturk.com\/veysel\/wp-content\/uploads\/2015\/12\/servicenow-icon.png",256,256,false]},"uagb_author_info":{"display_name":"VeYSeL","author_link":"https:\/\/dijitalturk.com\/veysel\/author\/veysel\/"},"uagb_comment_info":0,"uagb_excerpt":"If you want to set minimum attachment size control to sys_attachment table you can create business rule to sys_attachment table [&hellip;]","_links":{"self":[{"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/posts\/978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/comments?post=978"}],"version-history":[{"count":0,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/posts\/978\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/media\/586"}],"wp:attachment":[{"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/media?parent=978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/categories?post=978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dijitalturk.com\/veysel\/wp-json\/wp\/v2\/tags?post=978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}