[resolved] Custom post type meta box not saving (3 posts)

  1. eraleks
    Posted 2 years ago #

    I've made a local installation of wordpress to try and make custom post type.

    The idea is to make a custom post type where I can add all the theaters and performing spaces in Oslo (and in the end make the archive searchable and filterable after capacity, name or place).

    I've followed this tutorial. Pretty much doing exactly the same except adding more meta boxes (Capacity, Adress, URL and contact information.

    The problem is, when hitting publish only 1 of the metaboxes (kontaktinformasjon) gets saved. Everything I fill out in the other fields get erased and doesn't show.

    You can download my plug-in files here.

    Hope anyone is able to help or point me to the right place / what to change compared to the tutorial to get more fields to save.

  2. eraleks
    Posted 2 years ago #

    Found the mistake in a typo after hours of searching.

    Still I wonder what does the numbers in this piece of code do:

    add_action( 'save_post', 'add_lokaler_fields', 10, 2 );

  3. xenous
    Posted 1 year ago #

    10 = when to run 10 is default higher the number later the action will run
    2 = variables your function deal with

Topic Closed

This topic has been closed to new replies.

About this Topic