force_deactivation naopak znamen\u00e1 deaktivaci pluginu p\u0159i deaktivaci \u0161ablon.<\/li>\n<\/ul>\nCel\u00e9 pole s hodnotami m\u016f\u017eete opakovat pro tolik plugin\u016f, kolik budete pot\u0159ebovat. Podle toho, jak\u00e9 hodnoty nastav\u00edte, bude se po instalaci \u0161ablony zobrazovat upozorn\u011bn\u00ed, \u017ee jsou pluginy vy\u017eadov\u00e1ny, nebo doporu\u010deny. D\u00e1le se tak\u00e9 u upozorn\u011bn\u00ed zobraz\u00ed odkaz na instalaci a aktivaci plugin\u016f, tak\u017ee u\u017eivatel nemus\u00ed nic hledat. D\u00edky tomu, \u017ee je upozorn\u011bn\u00ed st\u00e1le viditeln\u00e9, bude u\u017eivatel v\u011bd\u011bt, co m\u00e1 d\u011blat.<\/p>\n
Jako posledn\u00ed krok mus\u00edme do funkce p\u0159idat je\u0161t\u011b konfiguraci, tak\u017ee pod pole, kter\u00e9 jsme si vytvo\u0159ili p\u0159id\u00e1me n\u00e1sleduj\u00edc\u00ed \u0159\u00e1dky:<\/p>\n
$theme_text_domain = 'tgmpa';<\/pre>\nTextovou dom\u00e9nu pro p\u0159\u00edpadn\u00fd p\u0159eklad a pole $config kter\u00e9 m\u016f\u017eete nechat tak jak je a nemus\u00edte na n\u011bm nic m\u011bnit:<\/p>\n
\n$config = array(\n'domain' \t\t=> $theme_text_domain,\n'default_path' \t\t=> '',\n'parent_menu_slug' \t=> 'themes.php',\n'parent_url_slug' \t=> 'themes.php',\n'menu' \t\t=> 'install-required-plugins',\n'has_notices' \t=> true,\n'is_automatic' \t=> false,\n'message' \t\t\t=> '',\n'strings' \t\t=> array(\n'page_title'=> __( 'Install Required Plugins', $theme_text_domain ),\n'menu_title'=> __( 'Install Plugins', $theme_text_domain ),\n'installing'=> __( 'Installing Plugin: %s', $theme_text_domain ), \/\/ %1$s = plugin name\n'oops'=> __( 'Something went wrong with the plugin API.', $theme_text_domain ),\n'notice_can_install_required'=> _n_noop( 'This theme requires the following plugin: %1$s.',\n'This theme requires the following plugins: %1$s.' ),\n'notice_can_install_recommended'=> _n_noop( 'This theme recommends the following plugin: %1$s.',\n'This theme recommends the following plugins: %1$s.' ),\n'notice_cannot_install'=> _n_noop( 'Sorry, but you do not have the correct permissions\nto install the %s plugin. Contact the administrator of this site for help on\ngetting the plugin installed.', 'Sorry, but you do not have the correct permissions\nto install the %s plugins. Contact the administrator of this site for\nhelp on getting the plugins installed.' ),\n'notice_can_activate_required'=> _n_noop( 'The following required plugin is currently\ninactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ),\n'notice_can_activate_recommended'=> _n_noop( 'The following recommended plugin is currently\ninactive: %1$s.', 'The following recommended plugins are currently\ninactive: %1$s.' ),\n'notice_cannot_activate'=> _n_noop( 'Sorry, but you do not have the correct permissions\nto activate the %s plugin. Contact the administrator of this site for help on getting the\nplugin activated.', 'Sorry, but you do not have the correct permissions to\nactivate the %s plugins. Contact the administrator of this site for help on\ngetting the plugins activated.' ),\n'notice_ask_to_update'=> _n_noop( 'The following plugin needs to be updated to its latest\nversion to ensure maximum compatibility with this theme: %1$s.', 'The following plugins\nneed to be updated to their latest version to ensure maximum compatibility\nwith this theme: %1$s.' ),\n'notice_cannot_update'=> _n_noop( 'Sorry, but you do not have the correct permissions to\nupdate the %s plugin. Contact the administrator of this site for help on getting the\nplugin updated.', 'Sorry, but you do not have the correct permissions to update the %s\n plugins. Contact the administrator of this site for help on getting\nthe plugins updated.' ),\n'install_link'=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),\n'activate_link'=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),\n'return'=> __( 'Return to Required Plugins Installer', $theme_text_domain ),\n'plugin_activated'=> __( 'Plugin activated successfully.', $theme_text_domain ),\n'complete'=> __( 'All plugins installed and activated successfully. %s', $theme_text_domain ),\n'nag_type'=> 'updated'\n\t\t)\n\t);\n<\/pre>\nP\u0159esto\u017ee vypad\u00e1 slo\u017eit\u011b, jedn\u00e1 se v\u011bt\u0161inou o v\u00fdpis r\u016fzn\u00fdch upozorn\u011bn\u00ed.<\/p>\n
Nakonec vlo\u017e\u00edme:<\/p>\n
tgmpa( $plugins, $config );<\/pre>\nPokud jste v\u0161e ud\u011blali spr\u00e1vn\u011b, po aktivaci va\u0161\u00ed \u0161ablony by se m\u011blo zobrazit upozorn\u011bn\u00ed na nutnost instalace definovan\u00fdch plugin\u016f. <\/p>\n","protected":false},"excerpt":{"rendered":"
Vytv\u00e1\u0159\u00edte vlastn\u00ed \u0161ablony, d\u011bl\u00e1te na zak\u00e1zku, nebo publikujete free vzhledy pro redak\u010dn\u00ed syst\u00e9m WordPress? Ur\u010dit\u011b jste se dostali do situace, kdy jste museli klientovi, nebo komukoliv jin\u00e9mu, kdo chce va\u0161i \u0161ablonu pou\u017e\u00edt, \u017ee aby se mu ty obr\u00e1zky h\u00fdbali stejn\u011b jako na demu, mus\u00ed si nainstalovat takov\u00fd a takov\u00fd plugin. M\u00e1m pro v\u00e1s tip na<\/p>\n","protected":false},"author":1,"featured_media":8624,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[12],"tags":[505],"class_list":["post-717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-navody","tag-wordpress-pluginy"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/717"}],"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=717"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8624"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}