Issue in fetching slug for Submit ticket in woocommerce menu
-
Hi,
I was facing an issue in fetching slug of submit link in my account page of woocommerce.
get_endpoint_name_for_openticket_page the function was returning page_id=0 and resulting a slug=0. So I have udpated it in my webapp, Requesting team to update the same, so the change may reflect globally.Old Code :
public function get_endpoint_name_for_openticket_page() { $slug = false ; // return value $page_ids = wpas_get_option('ticket_submit') ; // get the ids of the ticket pages from settings... if ( ! empty( $page_ids ) ) { $page_id = $page_ids[0]; $page = get_post( $page_id ) ; if ( ! empty( $page ) ) { $slug = $page->post_name; } } return $slug ; }
New Code :
public function get_endpoint_name_for_openticket_page() { $slug = false ; // return value $page_id = wpas_get_option('ticket_submit') ; // get the ids of the ticket pages from settings... if ( ! empty( $page_id ) ) { //$page_id = $page_ids[0]; $page = get_post( $page_id ) ; //echo $page; if ( ! empty( $page ) ) { $slug = $page->post_name; } } return $slug ; }
Thank You..!
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Issue in fetching slug for Submit ticket in woocommerce menu’ is closed to new replies.