{"id":1414,"date":"2014-01-10T20:45:01","date_gmt":"2014-01-10T20:45:01","guid":{"rendered":"http:\/\/musilda.cz\/?p=1414"},"modified":"2014-01-10T20:45:01","modified_gmt":"2014-01-10T20:45:01","slug":"funkce-get_post_status","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/funkce-get_post_status\/","title":{"rendered":"Funkce get_post_status"},"content":{"rendered":"
Jednoduch\u00e1 funkce, kter\u00e1 na z\u00e1klad\u011b id \u010dl\u00e1nku, vr\u00e1t\u00ed jeho aktu\u00e1ln\u00ed status. Pokud jde o id nahran\u00e9ho souboru, vr\u00e1t\u00ed aktu\u00e1ln\u00ed stav p\u0159i\u0159azen\u00e9ho postu (parent).\u00a0<\/p>\n
Pou\u017eit\u00ed:<\/p>\n
\nget_post_status( $ID )\n<\/pre>\n$ID je id \u010dl\u00e1nku, jeho\u017e status chcete z\u00edskat. Funkci m\u016f\u017eete pou\u017e\u00edt i mimo Loop.<\/p>\n
Hodnoty, kter\u00e9 m\u016f\u017ee funkce vr\u00e1tit:<\/p>\n
P\u0159\u00edklad pou\u017eit\u00ed:<\/p>\n
\nif ( get_post_status ( $ID ) == 'private' ) {\n\t\techo 'Soukrom\u00fd';\n\t} else {\n\t\techo 'Ve\u0159ejn\u00fd';\n\t}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Jednoduch\u00e1 funkce, kter\u00e1 na z\u00e1klad\u011b id \u010dl\u00e1nku, vr\u00e1t\u00ed jeho aktu\u00e1ln\u00ed status. Pokud jde o id nahran\u00e9ho souboru, vr\u00e1t\u00ed aktu\u00e1ln\u00ed stav p\u0159i\u0159azen\u00e9ho postu (parent).\u00a0<\/p>\n","protected":false},"author":1,"featured_media":8523,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[7,15],"tags":[],"class_list":["post-1414","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-codex","category-post-funkce"],"uagb_featured_image_src":{"full":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu.png",1200,800,false],"thumbnail":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu-150x150.png",150,150,true],"medium":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu-300x200.png",300,200,true],"medium_large":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu-768x512.png",640,427,true],"large":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu-1024x683.png",640,427,true],"1536x1536":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu.png",1200,800,false],"2048x2048":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu.png",1200,800,false],"archive-list":["https:\/\/affinite.io\/cs\/wp-content\/uploads\/sites\/2\/2014\/12\/funkce-ve-wordpressu-400x265.png",400,265,true]},"uagb_author_info":{"display_name":"Affinite","author_link":"https:\/\/affinite.io\/cs\/author\/affinite\/"},"uagb_comment_info":0,"uagb_excerpt":"Jednoduch\u00e1 funkce, kter\u00e1 na z\u00e1klad\u011b id \u010dl\u00e1nku, vr\u00e1t\u00ed jeho aktu\u00e1ln\u00ed status. Pokud jde o id nahran\u00e9ho souboru, vr\u00e1t\u00ed aktu\u00e1ln\u00ed stav p\u0159i\u0159azen\u00e9ho postu (parent).\u00a0","_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1414"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=1414"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1414\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8523"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}