Support

Account

Home Forums Feature Requests Custom metadata tables

Helping

Custom metadata tables

  • Hi There,

    I would like to be able to customise what metadata table my metadata is stored in for different post types.

    The reason for this is because my postmeta table has become very large and slow. This will allow me to split up the data into different tables.

    I think all that is needed is a simple 1 line change in:

    /includes/api/api-helpers.php line 3134

    //Change 
    $meta = array('post', 'user', 'comment', 'term');
    //To
    $meta = apply_filters('acf/metadata_type/', array('post', 'user', 'comment', 'term'));
  • These values are used in the built in functions get_metadata() https://codex.wordpress.org/Function_Reference/get_metadata and update_metadata(). The values in the code you referenced are the only ones this function allows. ACf does not do the queries directly and depends on WP do to the work.

    You may find some inspiration here on how this might be possible https://awesomeacf.com/storing-acf-data-custom-database-tables/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.