• Resolved Pierre_02

    (@pierre_02)


    Hi George.

    I do my best to be understandable :).

    So, here’s my problem :
    I use the plugin “Simply Static” to generate static websites from a WP multisite installation.
    URLs of dynamic websites are :
    https://site1.domain.tld/
    https://site2.domain.tld/
    URLs of static websites are :
    https://www.domain1.tld/
    https://www.domain2.tld/
    In each static website, URLs in the form are not touched. So they link to the dynamic websites. But by doing that all the form are posted to the websites “protected” by your plugin so when a user submit a form the datas are blocked with a 503 error :(.

    So is there’s a way to permit POST datas to go through WP Maintenance and BTW allow datas to be posted?

    TIA for your precious help.

    Pierre.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @pierre_02,

    You can use the wpmm_is_excluded filter to exclude the $_POST requests.

    Try this snippet:

    
    /**
     * Exclude $_POST requests
     *
     * @param boolean $is_excluded
     * @return boolean
     */
    function wpmm_exclude_post_requests($is_excluded) {
        if(empty($_POST)) {
            return $is_excluded;
        }
    
        return true;
    }
    
    add_filter('wpmm_is_excluded', 'wpmm_exclude_post_requests', 10, 1);
    


    George

    • This reply was modified 6 years, 7 months ago by George J.
    Thread Starter Pierre_02

    (@pierre_02)

    WOUHOU 😀 !!

    Thanks a lot George ! Your code works so fine :D!!
    You made my day 😀 !!!

    Have a great evening 🙂 !!

    Pierre.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Allow POST method’ is closed to new replies.