{"id":6549,"date":"2022-01-01T10:33:00","date_gmt":"2022-01-01T10:33:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=6549"},"modified":"2022-01-01T10:33:00","modified_gmt":"2022-01-01T10:33:00","slug":"jak-pridat-vlastni-placeholder-do-e-mailu-woocommerce","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-pridat-vlastni-placeholder-do-e-mailu-woocommerce\/","title":{"rendered":"Jak p\u0159idat vlastn\u00ed placeholder do e-mailu WooCommerce"},"content":{"rendered":"\n

E-maily WooComerce v z\u00e1kladu obsahuj\u00ed n\u011bkolik placeholder\u016f, kter\u00e9 se daj\u00ed pou\u017e\u00edt v textech e-mailu a umo\u017e\u0148uj\u00ed p\u0159idat informaci z ulo\u017een\u00fdch dat. <\/p>\n\n\n\n

Ve snippetu https:\/\/musilda.cz\/pridani-jmena-do-predmetu-e-mailu-woocommerce\/<\/a>, jsme p\u0159edm\u011bt e-mailu zm\u011bnili a p\u0159idali do n\u011bj osloven\u00ed. <\/p>\n\n\n\n

Tento postup bohu\u017eel neumo\u017e\u0148uje upravit text p\u0159edm\u011btu jinak, ne\u017e \u00fapravou k\u00f3du. <\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

A proto\u017ee my chceme m\u00edt mo\u017enost p\u0159epsat v nastaven\u00ed, pou\u017eijeme n\u00e1sleduj\u00edc\u00ed k\u00f3d:<\/p>\n\n\n\n

add_filter( 'woocommerce_email_format_string', 'musilda_custom_email_placeholder', 10, 2 );\nfunction musilda_custom_email_placeholder( $text, $email ) {\n\n\treturn str_replace( '{first_name}', $email->object->get_billing_first_name(), $text );\n\n}<\/code><\/pre>\n\n\n\n

D\u00edky t\u00e9to funkci m\u016f\u017eeme v e-mailu pou\u017e\u00edt vlastn\u00ed placeholder:<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n\n\n\n

A v p\u0159edm\u011btu e-mailu pak uvid\u00edme hodnotu, kterou chceme:<\/p>\n\n\n\n

\"\"<\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"

E-maily WooComerce v z\u00e1kladu obsahuj\u00ed n\u011bkolik placeholder\u016f, kter\u00e9 se daj\u00ed pou\u017e\u00edt v textech e-mailu a umo\u017e\u0148uj\u00ed p\u0159idat informaci z ulo\u017een\u00fdch dat. Ve snippetu https:\/\/musilda.cz\/pridani-jmena-do-predmetu-e-mailu-woocommerce\/, jsme p\u0159edm\u011bt e-mailu zm\u011bnili a p\u0159idali do n\u011bj osloven\u00ed. Tento postup bohu\u017eel neumo\u017e\u0148uje upravit text p\u0159edm\u011btu jinak, ne\u017e \u00fapravou k\u00f3du. A proto\u017ee my chceme m\u00edt mo\u017enost p\u0159epsat v nastaven\u00ed, pou\u017eijeme n\u00e1sleduj\u00edc\u00ed<\/p>\n","protected":false},"author":1,"featured_media":5600,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-6549","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-woocommerce-snippety"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6549"}],"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=6549"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/6549\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/5600"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=6549"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=6549"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=6549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}