HeyPublisher / heypublisher-submission-manager

HeyPublisher Wordpress Plugin
GNU General Public License v2.0
2 stars 1 forks source link

Normalize all calls to make a URL into one function #35

Open aguywithanidea opened 8 years ago

aguywithanidea commented 8 years ago

We have separate calls everywhere that all do basically the same thing:

$form_post_url = sprintf('%s/wp-admin/admin.php?page=%s',get_bloginfo('wpurl'),$this->slug);

or ...

  private function form_action() {
    $action = sprintf('admin.php?page=%s',$this->slug);
    return $action;
  }

    $link_url = sprintf('%s&action=create_form_page',$this->form_action());
    if(function_exists('wp_nonce_url')){
      $link_url = wp_nonce_url($link_url,'create_form');
    }

or ...

$hp_base->get_form_post_url_for_page($this->slug);

This should be a common function

aguywithanidea commented 2 years ago

Solve needs to ensure nonced_url() can handle the cases that get_form_url_for_page() function has been handline. The former always creates absolute URLs, while the latter creates relative URLs. Need to resolve this difference as well.

Then all explicit calls should be updated to use nounced_url()

aguywithanidea commented 2 years ago

Patched by 94f92bb