0

I have a custom plugin that is integrated with woocommerce. I want to display listing records in the user's profile and have successfully done so. Creating the end points. refreshing the permalinks. Yet, the call back to drawing the content within the endpoint tab does not appear. Only the dashboard.

 function mylistings_account_menu_items( $items ) 
   {
    $items['mylistings'] = __( 'Active Listings', 'mylistings' );
    return $items;
   }
 add_filter( 'woocommerce_account_menu_items', 'mylistings_account_menu_items', 10, 1 );

  function mylisting_add_my_account_endpoint() 
   {
    add_rewrite_endpoint( 'mylistings', EP_PAGES ); 
    }
 add_action( 'init', 'mylisting_add_my_account_endpoint' );


 // THIS DOES NOT APPEAR TO BE WORKING WHY?

 function mylistings_information_endpoint_content() 
   {
    echo 'THIS IS A TEST OF THE CONTENT';
   }
  add_action( 'woocommerce_account_information_endpoint', 'mylistings_information_endpoint_content' );

What am I missing?

1

Dang it...must be blind....FOUND IT. The solution is, that since this is a custom hook, and most likely using JQuery, you place the end point action within the call.

Instead of this:

  function mylistings_information_endpoint_content() 
    {
     echo 'THIS IS A TEST OF THE CONTENT';
    }
   add_action( 'woocommerce_account_information_endpoint', 'mylistings_information_endpoint_content' );

It is this:

  function **mylistings**_information_endpoint_content() 
    {
     echo 'THIS IS A TEST OF THE CONTENT';
    }
   add_action( 'woocommerce_account_**mylistings**_endpoint', 'mylistings_information_endpoint_content' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.