Posted: December 24, 2018 at 10:06 am
|
Hello, Added a new plugin called buttontext and inside there I placed the functions.php file. I checked the permissions and they are RW—R like my other plugins but it is not working. |
Hi, May I ask did the plugin get activated on the WP > Plugins page? If it’s activated, can you post a copy of the code into a pastebin or GitHub Gist, then link to that code here? |
|
|
It is not showing up in my plugins in the wordpress console code i used is: //Another example that uses a custom field within the event. function tw_ee_custom_filter_ticket_selector_submit_button_text( $btn_text, $event ) { $purchase_tickets = $event->get_post_meta( ‘ee_purchase_tickets’, true ); if ( $purchase_tickets ) { return $btn_text; |
OK, so the reason you’re not seeing the plugin in WP > Plugins is because you did not follow this guide: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ What you’ll need to do is follow that guide, then put your code into the plugin you’ve created. Then you activate the plugin. |
|
|
I did follow the instructions. See screenshots |
Ok, I wrote that function so first let’s clarify how that specific function works. This line:
Is looking for a custom field on the event called ‘ee_purchase_tickets’ and will only change the text if that has been set, why? Because when I wrote that function it was requested to be applied only to specific events. So that function as you have it now, only works if you have something like this in the event – http://take.ms/XihBF If you are looking to change ‘Register Now’ to ‘Purchase Tickets’ on all events automatically you use the first function.php file in the Gist: https://gist.github.com/Pebblo/6ca533539b2ed37ed88801825fdd2f2f#file-functions-php Notice how the first file doesn’t have the line I mentioned? It just changes the text on all events. |
|
Your plugin is also missing the plugin header, so WordPress will not recognize that it’s a plugin. That’s step 5 in the instructions for setting up a custom plugin. What you’ll need to do is right after the opening PHP add this:
Then, after you save the file, you can refresh the WP > Plugins page and you’ll see the plugin and be able to activate it. |
|
The support post ‘Changing Button Text From Register Now to Purchase Tickets’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.