WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #36292, comment 4


Ignore:
Timestamp:
03/22/2016 12:46:06 PM (6 years ago)
Author:
giuseppe.mazzapica
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36292, comment 4

    initial v1  
    11I really like the effort on this.
    22
    3 As the guy who wrote the article you mentioned and Cortex (the library mentioned in the article) as well as exploring the concept since 2 years (in 2014 I release the now abandoned "Clever Rules" https://github.com/Giuseppe-Mazzapica/CleverRules) I have some things to say...
     3As the guy who wrote the article you mentioned and Cortex (the library mentioned in the article) as well as one who is exploring the concept since 2 years (in 2014 I released the now abandoned "Clever Rules" https://github.com/Giuseppe-Mazzapica/CleverRules) I have some things to say...
    44
    55A class for each a rule is overwhelming imo.
     
    7676add_rewrite_callback(
    7777   "^/some/path/here?",
    78    function($matches) {
     78   function(array $matches, WP_HTTP_Request $request) {
    7979       do_something_interesting();
    8080       wp_safe_redirect( home_url() );
     
    9090add_rewrite_callback(
    9191   "^/some/path/here?",
    92    function($matches) {
     92   function(array $matches, WP_HTTP_Request $request) {
    9393       wp_send_json_success( array( 'cool' => true ) );
    9494   },