Migrate from Vafpress

Ask a question

Depend on FavPress

Depend on FavPress instead Vafpress

Replace prefixes

  1. Replace the old prefix vp used by Vafpress with favpress.
  2. Replace the old prefix VP used by Vafpress with FavPress.

Example

Old Vafpress code

    $theme_options = new VP_Option(array(
        ...
    ));

    $option = vp_option('option');
    $metabox = vp_metabox('metabox');


New FavPress code

    $theme_options = new FavPress_Option(array(
        ...
    ));

    $option = favpress_option('option');
    $metabox = favpress_metabox('metabox');

Set mode for metaboxes

In FavPress we have changed the default mode for metaboxes from WPALCHEMY_MODE_ARRAY to WPALCHEMY_MODE_EXTRACT.

To keep your metaboxes compatible you should set the old mode explicitly:


    $mb = new FavPress_Metabox(array(
        'mode'    => WPALCHEMY_MODE_ARRAY
    ));

Set mode for upload fields

In FavPress we have changed the default behaviour for upload fields to store the uploads id instead the url.

To keep your fields compatible you should set the old mode explicitly:


    'fields' => array(
        array(
            'type' => 'upload',
            'mode'    => CONTROL_FIELD_UPLOAD_MODE_VALUE_URL
        ),
    )