Пример #1
0
/**
 * Inits custom types.
 */
function wpcf_custom_types_init()
{
    $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());
    if (!empty($custom_types)) {
        foreach ($custom_types as $post_type => $data) {
            wpcf_custom_types_register($post_type, $data);
        }
    }
}
Пример #2
0
/**
 * Inits custom types.
 */
function wpcf_custom_types_init()
{
    $custom_types = get_option('wpcf-custom-types', array());
    if (!empty($custom_types)) {
        foreach ($custom_types as $post_type => $data) {
            wpcf_custom_types_register($post_type, $data);
        }
    }
}
Пример #3
0
/**
 * Inits custom types.
 */
function wpcf_custom_types_init()
{
    $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());
    if (!empty($custom_types)) {
        foreach ($custom_types as $post_type => $data) {
            if (empty($data)) {
                continue;
            }
            if (isset($data['_builtin']) && $data['_builtin'] || wpcf_is_builtin_post_types($post_type)) {
                continue;
            }
            wpcf_custom_types_register($post_type, $data);
        }
    }
}
/**
 * Inits custom types.
 */
function wpcf_custom_types_init()
{
    $custom_types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());
    if (!empty($custom_types)) {
        foreach ($custom_types as $post_type => $data) {
            if (empty($data)) {
                continue;
            }
            if (isset($data['_builtin']) && $data['_builtin'] || wpcf_is_builtin_post_types($post_type)) {
                continue;
            }
            wpcf_custom_types_register($post_type, $data);
        }
    }
    // rearrange menu items
    add_filter('custom_menu_order', '__return_true');
    add_filter('menu_order', 'wpcf_custom_types_menu_order_set');
    // rearrange menu items - end
    /** This filter is documented in wp-admin/wp-admin/edit-form-advanced.php */
    add_filter('enter_title_here', 'wpcf_filter_enter_title_here', 10, 2);
}