'page' ); $postarr['post_status'] = 'publish'; $post_content = __( 'Returns page content here', EasyPack::$text_domain );; $postarr['post_title'] = __( 'InPost Returns', EasyPack::$text_domain ); $country = $_POST['country']; $country = strtoupper( str_replace( 'test-', '', $country ) ); if ( $country == 'GB' ) { $postarr['post_title'] = 'InPost Returns'; $post_content = ''; $post_content .= 'Returns available 24/7 from ANY parcel locker.

'; $post_content .= 'Simple, convenient and no line-ups!

'; $post_content .= '' . 'Return now' . ''; } if ( $country == 'PL' ) { $postarr['post_title'] = 'Szybkie zwroty InPost'; $post_content = ''; $post_content .= 'Zwracaj zamówienia przez ponad 1 100 Paczkomatów w całej Polsce.

'; $post_content .= 'Szybko, wygodnie, bez kolejek!

'; $post_content .= '' . 'Przejdź do szybkich zwrotów' . ''; } $postarr['post_content'] = ''; $postarr['post_content'] .= $post_content; $page_id = wp_insert_post( $postarr ); if ( $page_id ) { $page = get_page( $page_id ); $ret = array( 'page_id' => $page_id ); $ret['page_title'] = $page->post_title; $ret['message'] = __( 'Returns page created.', EasyPack::$text_domain ); echo json_encode( $ret ); } else { echo 0; } wp_die(); } public static function dispatch_point() { $dispatch_point_name = $_POST['dispatch_point_name']; try { $dispatch_point = EasyPack_API()->dispatch_point( $dispatch_point_name ); echo json_encode( $dispatch_point ); } catch ( Exception $e ) { echo 0; } wp_die(); } public static function parcel_machines_create_package() { EasyPack_Shippng_Parcel_Machines::ajax_create_package(); } public static function parcel_machines_cancel_package() { EasyPack_Shippng_Parcel_Machines::ajax_cancel_package(); } public static function parcel_machines_get_stickers() { EasyPack_Shippng_Parcel_Machines::ajax_get_stickers(); } public static function parcel_machines_cod_get_payment_status() { EasyPack_Shippng_Parcel_Machines_COD::ajax_get_payment_status(); } public static function parcel_machines_cod_create_package() { EasyPack_Shippng_Parcel_Machines_COD::ajax_create_package(); } public static function parcel_machines_cod_cancel_package() { EasyPack_Shippng_Parcel_Machines_COD::ajax_cancel_package(); } public static function crossborder_parcel_machines_create_package() { EasyPack_Shippng_Cross_Border_Parcel_Machines::ajax_create_package(); } public static function crossborder_parcel_machines_processing() { EasyPack_Shippng_Cross_Border_Parcel_Machines::ajax_processing(); } public static function crossborder_courier_create_package() { EasyPack_Shippng_Cross_Border_Courier::ajax_create_package(); } public static function crossborder_courier_processing() { EasyPack_Shippng_Cross_Border_Courier::ajax_processing(); } public static function easypack_dispatch_order() { EasyPack_Shippng_Parcel_Machines::ajax_dispatch_order(); } public static function create_stickers() { EasyPack_Helper()->ajax_create_stickers(); } } endif; EasyPack_AJAX::init();