Step 1: Remove the Post Cap.
I started by putting a block of scrap wood under the lip of the post cap and tapping it loose with a hammer.
It was secured with glue and 4 dowels (one on each side)
As soon as I had enough clearance I sawed through the dowels with a fine tooth razor saw.
Step 2: Modify the Post
I measured the distance to the bottom of the post and subtracted the distance I wanted the shelf to be from the top.
It is simply a piece of scrap 2x4 from my garage with a piece of square plywood attached with one screw. I cut the plywood square about 1/8" less than the opening to make an easy fit.
Once assembled the leg just drops in.
I chiseled out notches in the post and the cap so I could mount a small hinge and still have the cap sit flush.
Then using a fortsner bit I drilled holes to allow rare-earth magnets to be flush mounted. I initially glued them in, but that didn't hold. So at the bottom of each magnet hole, I drove a bugle head (flat top) screw in. I then use expanding polyurethane glue (Gorilla) and set the magnets in. Then I had to chisel a grove to mount the flat metal bar on the cap. I think it may have been overkill, but I mounted 2 magnets behind the bar as well.
It works great. You really have to pull hard to open it.