Closed dylanlawrence closed 4 months ago
Unfortunatley that doesn't work in my test environment. REPR_APPS_PATH is based WP_CONTENT_DIR.
Could you share your configuration? I don't know much about custom folder configurations in WordPress, except that they exist.
I just use https://roots.io/bedrock/ for WordPress projects. It just moves some directories to a more sensible app structure and creates a config with multiple environments.
On Sun, Feb 18, 2024, 2:34 PM rockiger @.***> wrote:
Unfortunatley that doesn't work in my test environment. REPR_APPS_PATH is based WP_CONTENT_DIR.
Could you share your configuration? I don't know much about custom folder configurations in WordPress, except that they exist.
— Reply to this email directly, view it on GitHub https://github.com/rockiger/reactpress/issues/49#issuecomment-1951467944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANQLA5I7SDDXK4KIMX2QTLYUJ6W5AVCNFSM6AAAAABDJJYQSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGQ3DOOJUGQ . You are receiving this because you authored the thread.Message ID: @.***>
Ok, thanks. I will try to find a solution for Bedrock that doesn't collide with the default structure (at least with my LocalWP installation).
Do I understand this correctly: You did create a workaround for yourself to ReactPress and can wait to until the next release for any fixing this issue?
Yes WP_CONTENT_DIR and WP_CONTENT_URL seems to work as prefix.
I have another issue though where I have to remove & re-add the Target Page after it breaks during the "Update Dev-Environment". I think it's related to the same path issue, but I can't figure out why.
I created a pull request with changes regarding the loading of the css- and js-assets. It works on my local Bedrock installation. Do you care to give it a try?
This looks good, the only thing I see now is the "Edit" on the Admin App, I was having issues with PR for this branch, maybe a patch - adminAppEdit.patch
Great, I applied the patch. It works great.
I will wait a few days until I create a new release. Another user had a similar problem (that is why I use ABSPATH
constant) and want to give him the chance to test and provide feedback on our solution.
I hope this fine with you?
I'm using an environment that has a custom directory structure, so when it comes to content path it requires the correct wp call for the specific directory.
My main issue is shows up in the app_path method,
which I'm able to solve with WP_CONTENT_DIR like so:
I'm also seeing several other similar issues, that can be easily corrected by prefixing with -
content_url()
before asset filesexample - /plugins/reactpress/public/User.php:247
wp_enqueue_script('rp-react-app-asset-' . $app_index . '-' . $index,
content_url(). $js_file, array(), '1', true);
then also the admin react form for Target Pages > Edit needs a base
admin_url()
/wp-admin.php
; example :echo wp_json_encode(['status' => 1, 'admin_url' => admin_url(), 'apps' => $apps]);
then you would need to build this in your app with the ${admin_url}/edit link path etc.