I have a wordpress site with paypal button integrated. It works as expected. I want to use IPN to do the following after a successful payment:
1) Send Email to buyer
2) change the user role in wordpress
Question is how do I embed a standalone PHP file in wordpress which will be called by IPN and has access to wordpress functions ?
Ideally what you want to do is add a stand alone file in your theme root e.g. ipn.php, in it call wordpress core functions.
put this at the top of the ipn file.
<?php require_once("../../../wp-load.php");?>
now you can get all wordpress functions inside.
Related
I use Laragon with WordPress to develop locally and then move my websites to Bluehost. I wanted to have a Subscribe button on a blog page so people can get notified of new blog posts. I signed up for MailChimp and used free version which generated for me HTML form embed. I placed that HTML in my index.php which handles blog posts.
Question: I am able to subscribe with new email addresses and see those in the Audience Contacts list in MailChimp dashboard but when I created a test post I don't get any notification emails about new content. Does it have to do with Laragon as this is local environment or some WordPress settings or it just on MailChimp level?
We want to use the Wordpress Rest-API to build a page decoupled from the backend. A few things still bother us though:
Within the wordpress backend one can add links in the content editor of a page or a post and one gets normally a list of all existing pages and posts of the same page to link to them. By decoupling the backend it does not know the exact urls to other pages and we need to provide this. Is there a possibility to tell wordpress what links are available?
Thanks in advance.
Cheers
For those looking for the answer:
There are two URL settings under Settings > General.
WordPress Address (URL) should be the URL for your api site. Like api.whatever.com.
Site Address (URL) should be the URL for the frontend. Like www.whatever.com.
This allows the internal linking to work properly in the Editor while keeping the backend site on a separate URL from a headless frontend.
I'm not sure what you're trying to ask. The WordPress REST API just provides a way to access posts, etc. from somewhere else part from the web site side (e.g. themes, etc). Pages would still be accessible from the admin backend and the JSON/REST API: https://developer.wordpress.org/rest-api/reference/pages/
Specifically with WordPress you could ensure that you're not rewriting the permalinks. That way they are all still site.com/?p=post-id
That way it's easy to parse fetch the new pages. Then replace the hrefs with whatever your frontend needs.
You could use the ID to fetch the slug of the new post immediately.
Or you could even keep a mapping in your presentation layer of IDs to your own slugs.
Changing the site_url doesn't work for me.
Since I also have a wordpress theme with custom rest controllers
Plus the wp-json breaks if I change the site url
My backend is hosted at digital ocean app
My frontend is hosted at vercel
I fixed it by using a wordpress plugin called make-paths-relative
But since my backend doesnt know where my frontend is I added one change within the plugin at:
frontend/class-make-paths-relative.php line 123
I added a constant FRONTEND_URL which i define in the wp-config
$relative_link = FRONTEND_URL.$link;
This changes both the permalink within my backend of a post, page or cpt
And changes internal links as wel, links within the content editor
I made a request to the plugin author as well
I'm not sure if this is possible. I'm trying to use the wordpress default registration form and have the information captured in infusionsoft. Before this, I tried creating a webform in infusionsoft and used that inside wordpress (from this tutorial http://infusedaddons.com/docu/InfusedWooPRO/lessons/Using_Infusionsoft_Web_Form_as_Wordpress_Registration_Form.html), infusionsoft captures the login information but it doesn't create a user inside wordpress. Is there a way to capture it using wordpress default registration form or a maybe a plugin?
Yes, it's possible. Wordpress installation I sometimes work on uses Infusionsoft Order Form for registration, sending back HTTP POST to wordpress, to create a new user account using Optimizemember plugin.
I have a WordPress website in which default payment gateway is stripe, but I need PayPal. But this theme stop PayPal support, So what I need to do for using PayPal in this theme.
theme is: http://demo.hellovideoapp.com/
You need to edit PHP pages of the theme on which you want implement PayPal Payment method or whatever you want. Also you need to edit your configuration file i.e. web.config (via CPanel if your website is published).
For further help please check the following documents and code samples:
https://github.com/paypal/PayPal-PHP-SDK
i want to make an wordpress plugin, and to put it public, but i want that only the users that have a certain unique code to be able to activate it.
is there possible using the wordpress api to ask for a unique code at plugin activation (and to condition the plugin activation by this code)? I searched wordpress codex, but nothing found.
thanks a lot!
This sounds like the old akismet plugin which required users to register for an API token. You can as part of your plugin require users to enter settings and at this point prompt them to register for an API key.
See the WordPress codex for adding an options page.
Also see this example for a good example of hooking into the plugin activation: