# api.modifyClass sometimes(!) not working

**URL:** <https://meta.discourse.org/t/api-modifyclass-sometimes-not-working/212413>\
**Category:** Bug\
**Created:** [December 17, 2021, 7:54am UTC](https://meta.discourse.org/t/api-modifyclass-sometimes-not-working/212413 "2021-12-17T07:54:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [December 17, 2021, 9:49am UTC](https://meta.discourse.org/t/api-modifyclass-sometimes-not-working/212413/2 "2021-12-17T09:49:34Z")

</div>

Oh my word. I might know!

I think that you need to add a `pluginId`

```plaintext
     <script type="text/discourse-plugin" version="0.1">
    api.modifyClass('model:user', {
      pluginId: 'my-plugin', 
      testProperty: function() {
        return 1;
      } 
    });
</script>

```

It’s required on later versions, I actually submitted PRs for a couple themes yesterday to add this. I might be turning into a plugin/theme developer at long last

---

_[View the full topic](https://meta.discourse.org/t/api-modifyclass-sometimes-not-working/212413)._
