예제 #1
0
 /**
  * @since 3.0.2
  */
 public function handle_email_verification_link()
 {
     $ad_id = $this->request->get_query_var('awpcp-ad');
     $hash = $this->request->get_query_var('awpcp-hash');
     $ad = AWPCP_Ad::find_by_id($ad_id);
     if (is_null($ad) || !awpcp_verify_email_verification_hash($ad_id, $hash)) {
         wp_redirect(awpcp_get_main_page_url());
         return;
     }
     $this->verify_ad($ad);
     wp_redirect(esc_url_raw(add_query_arg('verified', true, url_showad($ad->ad_id))));
     return;
 }
예제 #2
0
function awpcp_get_menu_items()
{
    $items = array();
    $user_is_allowed_to_place_ads = !get_awpcp_option('onlyadmincanplaceads') || awpcp_current_user_is_admin();
    $show_place_ad_item = $user_is_allowed_to_place_ads && get_awpcp_option('show-menu-item-place-ad');
    $show_edit_ad_item = $user_is_allowed_to_place_ads && get_awpcp_option('show-menu-item-edit-ad');
    $show_browse_ads_item = get_awpcp_option('show-menu-item-browse-ads');
    $show_search_ads_item = get_awpcp_option('show-menu-item-search-ads');
    if ($show_place_ad_item) {
        $place_ad_url = awpcp_get_page_url('place-ad-page-name');
        $place_ad_page_name = get_awpcp_option('place-ad-page-name');
        $items['post-listing'] = array('url' => $place_ad_url, 'title' => esc_html($place_ad_page_name));
    }
    if ($show_edit_ad_item) {
        $items['edit-listing'] = awpcp_get_edit_listing_menu_item();
    }
    if ($show_browse_ads_item) {
        if (is_awpcp_browse_listings_page() || is_awpcp_browse_categories_page()) {
            if (get_awpcp_option('main_page_display')) {
                $browse_cats_url = awpcp_get_view_categories_url();
            } else {
                $browse_cats_url = awpcp_get_main_page_url();
            }
            $view_categories_page_name = get_awpcp_option('view-categories-page-name');
            $items['browse-listings'] = array('url' => $browse_cats_url, 'title' => esc_html($view_categories_page_name));
        } else {
            $browse_ads_page_name = get_awpcp_option('browse-ads-page-name');
            $browse_ads_url = awpcp_get_page_url('browse-ads-page-name');
            $items['browse-listings'] = array('url' => $browse_ads_url, 'title' => esc_html($browse_ads_page_name));
        }
    }
    if ($show_search_ads_item) {
        $search_ads_page_name = get_awpcp_option('search-ads-page-name');
        $search_ads_url = awpcp_get_page_url('search-ads-page-name');
        $items['search-listings'] = array('url' => $search_ads_url, 'title' => esc_html($search_ads_page_name));
    }
    $items = apply_filters('awpcp_menu_items', $items);
    return $items;
}
예제 #3
0
 private function render_delete_listing_confirmation()
 {
     $this->messages[] = __('Your Ad has been successfully deleted.', 'AWPCP');
     $template = AWPCP_DIR . '/templates/frontend/edit-listing-page-delete-listing-confirmation.tpl.php';
     return $this->render($template, array('messages' => $this->messages, 'main_page_url' => awpcp_get_main_page_url()));
 }
예제 #4
0
/**
 * @deprecated deprecated since 2.0.6.
 */
function url_classifiedspage()
{
    return awpcp_get_main_page_url();
}