WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. eraleks
    Member
    Posted 11 months 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
    Member
    Posted 11 months 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
    Member
    Posted 7 months ago #

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

Reply

You must log in to post.

About this Topic