Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter malcolmdixon

    (@malcolmdixon)

    So, the best option is to use the slower admin-ajax.php method but it will be more secure. Okay, I’ll check out more videos on this option and read in-depth rather than skimming!

    Thanks again for your replies.

    Thread Starter malcolmdixon

    (@malcolmdixon)

    Hi Joy,

    This is just a small part of the site whereby any unauthorized user can use the form to find a particular product or service related to the site. Every interaction will be READ ONLY.
    Only admins can CRUD the CPTs, the data is consumed by the Ajax calls in the form only.
    Yes, the intention is that it will be like a single page app for this part of the site.
    As far as I can tell I’m getting access to all of WP functions required providing wp-load.php has been required.
    My terminology and explanations may not be precise as I’m still in the learning phase.
    I hope that helps you understand what I’m trying to achieve, so that you can provide any useful tips. I really appreciate you taking time to respond, thank you Joy.

    Thread Starter malcolmdixon

    (@malcolmdixon)

    Hi Joy,

    Thanks for the reply.

    The goal is to have a multi step form that could start at different steps, so depending on the starting step determines whether data needs to be loaded into the 3D rotating carousel I’ve developed. I don’t want the initial PHP file to create the DOM elements as they may not be needed, so the intention was depending on user selection an Ajax call will get the data to load the controls. Some steps will then have a value that is used to fetch data for the next step etc. I would prefer this to use Ajax than requesting another PHP file and refreshing the page.

    The CPTs are for site specific use only and will not be used elsewhere.

    I don’t understand what’s meant by the theme handling it! My knowledge is sadly lacking ATM. The 3 CPTs that will be needed are for back-end data to feed this form. To load data and images into controls and provide results dependent on user choices.

    I agree, I don’t want to reinvent the wheel, so I’ll take your advice onboard and avoid using SQL and use the WP_Query class instead. The thing is Joy I just don’t really know what I’m doing and I’m trying to find my way around ATM.

    But is it advisable to use the Rewrite API as shown? OR should I just use the REST API? OR call a single page as shown?

    Thread Starter malcolmdixon

    (@malcolmdixon)

    Resolved

    Thread Starter malcolmdixon

    (@malcolmdixon)

    Thanks for the actions during a page request link, seen that page on a video recently and thought I need to see that. Been on the other pages loads but thanks anyway. Got it working and your reply confirmed where I was going wrong so I appreciate your time spent.

    I’ll check out the DEBUG logging feature too.

    Thread Starter malcolmdixon

    (@malcolmdixon)

    Hi Joy,

    Thanks for the reply.

    I was just coming on the forum to make an update to that effect as I realised that after more research.

    TBH I just don’t know how WordPress works yet!

    I now know that the routing code is firing but $make_id has no value hence why I’m not getting any response. I don’t even know how to debug PHP running in my Docker container, so I just used update_option to put values in the database lol. I think I need X-Debug or something like that.

    So, the question is, if it’s routing why isn’t there a value in $make_id?

    EDIT: Rather than hide my embarrassment I will leave the above, but the reason it wasn’t working after I ensured my new init() function was called on instantiation rather than just activation was I was calling the incorrect URL! Forgot my base url of /api/v1, my Homer moment.

    So, it now works but the one puzzling thing is that I still had to manually Save Changes in Permalink settings. I thought the flush_rewrite_rules() during activation took care of that?

    Everything is easy when you know how but hard when you don’t.

    • This reply was modified 3 years, 9 months ago by malcolmdixon. Reason: Being a numb head

    @pavelevap, did you get this sorted?

    I’m having the same issue, using the DirectoryPress theme. What’s strange is that if I force a refresh bypassing cache the star rating is displayed!

    I’m going to play around with all the relevant settings (again).

    Hope someone can help!

    Thanks for that post sonsori, I think (fingers crossed) that this may have solved my issue.

    I’ve got such a sore head with banging it on the wall :-(.

Viewing 8 replies - 16 through 23 (of 23 total)