{"id":5139,"date":"2019-01-05T17:43:36","date_gmt":"2019-01-05T17:43:36","guid":{"rendered":"https:\/\/musilda.cz\/?p=5139"},"modified":"2019-01-05T17:43:36","modified_gmt":"2019-01-05T17:43:36","slug":"jak-ziskat-url-woocommerce-stranek","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-ziskat-url-woocommerce-stranek\/","title":{"rendered":"Jak z\u00edskat url WooCommerce str\u00e1nek"},"content":{"rendered":"
WooCommerce m\u00e1 pro r\u016fzn\u00e9 \u00fa\u010dely, p\u0159ipraven\u00e9 r\u016fzn\u00e9 str\u00e1nky. Ty tak\u00e9 p\u0159i instalaci vytv\u00e1\u0159\u00ed. Vy samoz\u0159ejm\u011b m\u016f\u017eete pou\u017e\u00edt konkr\u00e9tn\u00ed url t\u011bchto str\u00e1nek, ale pokud takov\u00fd odkaz d\u00e1te do k\u00f3du \u0161ablony, nebo pluginu a zm\u011bn\u00edte z n\u011bjak\u00e9ho d\u016fvodu url str\u00e1nky, odkaz p\u0159estane fungovat.<\/p>\n
Na\u0161t\u011bst\u00ed m\u00e1 WooCommerce funkci wc_get_page_id().<\/p>\n
Tu m\u016f\u017eete pou\u017e\u00edt v kombinaci s get_the_permalink() a vytvo\u0159it dynamick\u00fd odkaz, kter\u00fd v\u00e1m bude fungovat st\u00e1le.<\/p>\n
Krom\u011b t\u011bchto str\u00e1nek, m\u00e1 WooCommerce i takzvan\u00e9 endpointy. U nich je t\u0159eba pou\u017e\u00edt funkci wc_get_endpoint_url() spole\u010dn\u011b s get_option, proto\u017ee slug endpointu se m\u016f\u017ee m\u011bnit v nastaven\u00ed.<\/p>\n