douhan4243 2019-08-02 10:21
浏览 223

在wordpress中取消设置URL参数值

unset m=1 parameter values to null

abc.com/s=hotels&m=1

I have tried to unset using this code

function resetM() {
    if( isset( $request['m'] )){
        unset( $request['m'] );
    }
    return $request;
}

add_filter('resetM','request');

i want to &m=1 in url but the value of m is set to null

can any one help me in this

  • 写回答

1条回答 默认 最新

  • dongtong0796 2019-08-06 07:05
    关注

    Thanks for reply

    i have tweak my code and its working for me

    add_action("init","remove_m_parameter");
    function remove_m_parameter()
    {
      if(isset($_GET['m']))
      {
      unset($_GET['m']);
      }
    }
    
    评论

报告相同问题?