{"id":1881,"date":"2014-08-06T11:43:49","date_gmt":"2014-08-06T11:43:49","guid":{"rendered":"http:\/\/musilda.cz\/?p=1881"},"modified":"2014-08-06T11:43:49","modified_gmt":"2014-08-06T11:43:49","slug":"vlastni-statusy-pro-clanky","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/vlastni-statusy-pro-clanky\/","title":{"rendered":"Vlastn\u00ed statusy pro \u010dl\u00e1nky"},"content":{"rendered":"
M\u00e1te vlastn\u00ed magaz\u00edn, \u010di web, na kter\u00e9m pracuje v\u00edce u\u017eivatel\u016f a pot\u0159ebujete p\u0159idat ke \u010dl\u00e1nk\u016fm statusy, kter\u00e9 ve WordPressu nejsou? V dne\u0161n\u00edm \u010dl\u00e1nku si uk\u00e1\u017eeme, jak na to.<\/p>\n
Typick\u00fd p\u0159\u00edklad je obs\u00e1hl\u00fd web, na n\u011bm\u017e se pod\u00edl\u00ed v\u00edce u\u017eivatel\u016f, v r\u016fzn\u00fdch rol\u00edch. N\u011bkdo m\u016f\u017ee b\u00fdt autor, n\u011bkdo d\u011bl\u00e1 korekci \u010dl\u00e1nk\u016f, kontroluje pravopis, vhodnost \u010dl\u00e1nku, \u010di jej kone\u010dn\u011b schv\u00e1l\u00ed. V takov\u00e9m p\u0159\u00edpad\u011b je d\u016fle\u017eit\u00e9 d\u00e1t tomu, kdo bude na \u010dl\u00e1nku pracovat po v\u00e1s, v\u011bd\u011bt, jak\u00fd status pr\u00e1v\u011b m\u00e1. A proto se hod\u00ed m\u00edt mo\u017enost vytvo\u0159en\u00ed vlastn\u00edch status\u016f \u010dl\u00e1nk\u016f.<\/p>\n
Pro m\u00e9 pot\u0159eby jsem si p\u0159ipravil n\u00e1sleduj\u00edc\u00ed statusy:<\/p>\n
Jako prvn\u00ed si p\u0159id\u00e1me rozbalovac\u00ed v\u00fdb\u011br status\u016f do metaboxu v detailu p\u0159\u00edsp\u011bvku:<\/strong><\/p>\n Post submit box, je metabox, kde nastavujete publikaci \u010dl\u00e1nk\u016f. P\u0159id\u00e1me k\u00f3d pro zobrazen\u00ed selectu:<\/p>\nadd_action( 'post_submitbox_misc_actions', 'custom_status_metabox' );<\/pre>\n
function custom_status_metabox(){\nglobal $post;\n$custom = get_post_custom($post->ID);\nif(!empty($custom[\"_status\"])){\n$status = $custom[\"_status\"][0];\n}\n$i = 0;\n$custom_status = array(\n'Pravopisn\u00e9 chyby',\n'Korekce',\n'Zam\u00edtnuto',\n'Schv\u00e1leno',\n);\n$html = '<\/pre>\n