# Move require\_once "inc/custom.php"; to bottom of functions.php

**URL:** https://forum.pinegrow.com/t/move-require-once-inc-custom-php-to-bottom-of-functions-php/8250
**Category:** Feature Request
**Tags:** feature-request
**Created:** [July 18, 2023, 1:27pm UTC](https://forum.pinegrow.com/t/move-require-once-inc-custom-php-to-bottom-of-functions-php/8250 "2023-07-18T13:27:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jonroc](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/jonroc/32/2805_2.png) [@jonroc](https://forum.pinegrow.com/u/jonroc)
#### Post date: [July 18, 2023, 1:27pm UTC](https://forum.pinegrow.com/t/move-require-once-inc-custom-php-to-bottom-of-functions-php/8250/1 "2023-07-18T13:27:47Z")

</div>

Hello, I’ve found that I need to go into block code to make more advanced changes to some blocks that cannot be done via the UI. I’m able to get things started with the UI, then copy all the code to the blocks directory in my PG project. After that, I change the code and the only thing left is to manually register the block, but I can’t do that in inc/custom.php because it’s called before all the blocks are registered.

Can `require_once "inc/custom.php";` be called after the blocks in fuctions.php?

-Thanks!

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [October 24, 2023, 8:21am UTC](https://forum.pinegrow.com/t/move-require-once-inc-custom-php-to-bottom-of-functions-php/8250/2 "2023-10-24T08:21:35Z")

</div>

@jonroc the best way is to use WP hooks to ensure that the code runs at the correct time. For example, blocks are registered in the `init` hook with the default priority 10.

If you wish to run some code after all the blocks are registered use this in `inc/custom.php`:

```auto
add_action( 'init',function() {
    //do something
}, 100);

```

The priority parameter `100` causes this hook to be called at the end.
