<\/a><\/p>\nDob\u0159e, m\u016f\u017eete nam\u00edtnout, \u017ee ide\u00e1ln\u00ed je do k\u00f3du pluginu nezasahovat, ale ne\u017eijeme v ide\u00e1ln\u00edm sv\u011bt\u011b, v\u00fdvoj custom funkce nemus\u00edte dostat zaplacen\u00fd, zkr\u00e1tka, n\u011bkdy je to jedin\u00e1 cesta. M\u00e1me tedy dv\u011b mo\u017enosti.<\/p>\n
Odstran\u011bn\u00ed upozorn\u011bn\u00ed na aktualizaci pluginu<\/h2>\n
I kdy\u017e klientovi \u0159ekneme, \u017ee se tento plugin nesm\u00ed aktualizovat, tak na to m\u016f\u017ee zapomenout, nebo se najde aktivn\u00ed spolupracovn\u00edk, co prost\u011b pluginy aktualizuje. Proto m\u016f\u017eeme odstranit upozorn\u011bn\u00ed na aktualizaci, pomoc\u00ed tohoto k\u00f3du:<\/p>\n
\nadd_filter( 'site_transient_update_plugins', 'musilda_remove_plugin_updates' );\nfunction musilda_remove_plugin_updates( $value ) {\n unset( $value->response['muj-plugin\/muj-plugin.php'] );\n return $value;\n}\n<\/pre>\nOdstran\u011bn\u00ed pluginu, ze seznamu ostatn\u00edch plugin\u016f<\/h2>\n
Tento zp\u016fsob je trochu radik\u00e1ln\u011bj\u0161\u00ed, ale zase m\u00e1te jistotu, \u017ee se v\u00e1m nikdo nepokus\u00ed plugin ani neodinstalovat.
\nSta\u010d\u00ed pou\u017e\u00edt n\u00e1sleduj\u00edc\u00ed funkci:<\/p>\n
\nadd_action('pre_current_active_plugins', 'musilda_hide_plugin');\nfunction musilda_hide_plugin() {\n global $wp_list_table;\n $hide = array('muj-plugin\/muj-plugin.php');\n $myplugins = $wp_list_table->items;\n foreach ($myplugins as $key => $val) {\n if (in_array($key,$hide)) {\n unset($wp_list_table->items[$key]);\n }\n }\n}\n<\/pre>\nVarov\u00e1n\u00ed<\/h2>\n
Pokud budete n\u011bco podobn\u00e9ho d\u011blat, mus\u00edte si uv\u011bdomit, \u017ee u slo\u017eit\u011bj\u0161\u00edch plugin\u016f, mohou b\u00fdt aktualizacemi opravov\u00e1ny bezpe\u010dnostn\u00ed chyby, tak\u017ee doporu\u010duji si dob\u0159e rozmyslet, ne\u017e funkce pou\u017eijete.<\/p>\n","protected":false},"excerpt":{"rendered":"
Ka\u017ed\u00fd, kdo d\u011bl\u00e1 weby na WordPressu to zn\u00e1. V n\u011bkter\u00fdch pluginech jsou pot\u0159eba ud\u011blat zm\u011bny. Klient si prost\u011b p\u0159eje, aby to fungovalo trochu jinak. Mo\u017enosti m\u00e1te dv\u011b. M\u016f\u017eete napsat vlastn\u00ed plugin, nebo jeho funk\u010dnost p\u0159ev\u00e9st na \u0161ablonu. Druhou mo\u017enost\u00ed, kter\u00e1 je hodn\u011b vyu\u017e\u00edvan\u00e1 a z\u00e1rove\u0148 zatracovan\u00e1, je upravit k\u00f3d pluginu. A zde vznik\u00e1 velk\u00fd probl\u00e9m<\/p>\n","protected":false},"author":1,"featured_media":1978,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,30],"tags":[],"class_list":["post-1976","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","category-wordpress"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1976"}],"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=1976"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/1976\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/1978"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=1976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=1976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=1976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}