Creating Custom Routed Link URLs in WordPress with WordPress Dispatcher

Posted in:
Update time:2024-09-29

We offer WordPress Themes and Plugins Custom Development Services

This site has long undertaken WordPress themes, plugins, WooCommerce-based store mall development business. We have 10 years of experience in WordPress development, if you want to Developing Websites with WordPress, please contact WeChat: iwillhappy1314 or email: amos@wpcio.com for inquiries.

3 thoughts on “在 WordPress 中使用 WordPress Dispatcher 创建自定义路由链接 URL

  1. 最后的例子:

    new Dispatch( [
        'checkout/' => array(new CheckoutController, 'index'),
        'checkout/([a-z]+)' => array(new CheckoutController, 'show'), array($request, $id), 
        // 后面的参数中,$request = checkout/([a-z]+); $id = ([a-z]+);
    ] );

    , array($request, $id), 是代表另外一个数组元素吗,会不会有问题?

发表回复

Your email address will not be published. 必填项已用 * 标注

*