Example #1
0
        # Add optionally post type support
        if (Options::Get('enable_custom_fields')) {
            Add_Post_Type_Support(self::$post_type_name, 'custom-fields');
        }
    }
    static function addMetaBoxes()
    {
        # There will be added no other meta boxes yet
    }
    static function filterUpdatedMessages($arr_message)
    {
        return Array_Merge($arr_message, array(self::$post_type_name => array(1 => SPrintF(I18n::t('Term updated. (<a href="%s">View Term</a>)'), Get_Permalink()), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => I18n::t('Term updated.'), 5 => isset($_GET['revision']) ? SPrintF(I18n::t('Term restored to revision from %s'), WP_Post_Revision_Title((int) $_GET['revision'], False)) : False, 6 => SPrintF(I18n::t('Term published. (<a href="%s">View Term</a>)'), Get_Permalink()), 7 => I18n::t('Term saved.'), 8 => I18n::t('Term submitted.'), 9 => SPrintF(I18n::t('Term scheduled. (<a target="_blank" href="%s">View Term</a>)'), Get_Permalink()), 10 => SPrintF(I18n::t('Draft updated. (<a target="_blank" href="%s">Preview Term</a>)'), Add_Query_Arg('preview', 'true', Get_Permalink())))));
    }
    static function getArchiveLink($filter = '', $taxonomy_term = Null)
    {
        $permalink_structure = Get_Option('permalink_structure');
        # Get base url
        if ($taxonomy_term) {
            $base_url = Get_Term_Link($taxonomy_term);
        } else {
            $base_url = Get_Post_Type_Archive_Link(self::$post_type_name);
        }
        if (!empty($permalink_structure)) {
            return User_TrailingSlashIt(SPrintF('%1$s/filter:%2$s', RTrim($base_url, '/'), RawURLEncode($filter)));
        } else {
            return Add_Query_Arg(array('filter' => RawURLEncode($filter)), $base_url);
        }
    }
}
Post_Type::Init();