themosis / documentation

Official documentation of the Themosis framework.
http://framework.themosis.com/
52 stars 37 forks source link

Custom fields api call 404 #78

Closed pvdptje closed 5 years ago

pvdptje commented 5 years ago

I'm testing a bit, and i can't seem custom fields to get to work.

My code:

 PT::make('brand', 'Brands', 'brand')
                ->setLabels(['add_new_item' => 'Add a new brand'])
                ->setArguments([
                       'public' => true,
                       'menu_position' => 20,
                       'supports' => ['title', 'editor', 'post-thumbnail'],
                       'rewrite' => false,
                       'query_var' => false
                ])->set();

        Metabox::make('properties', 'brand')
               ->add(Field::text('test'))
               ->set();

The metabox is visible on the edit screen, however the fields do not get loaded. When inspecting in console we see a 404 error: Error: Request failed with status code 404

It's trying to do a call to http://mydomain.dev/wp-api/themosis/v1/metabox/properties?post_id=18 which gives a 404.

Any suggestions on how to fix this?

Thanks

pvdptje commented 5 years ago

I have saved my permalinks and the fields are now visible.