Posted: February 13, 2014 at 1:08 pm
3.8.1, 3.1.36.4.P, New, N/A. Hello, Just wondering if a way to easily change the default Twitter/Facebook message has been addressed? Would like to replace the @EE with a custom message. Thanks in advance. |
|
Hi Ronald, You can change the message in plugins/espresso-social/espresso-social.php about line 295. You may find this thread helpful as well: https://eventespresso.com/topic/change-twitter-message/ Thanks. |
|
Thanks, Nikki. Creating a custom plugin with the provided code worked like a charm. However, I don’t see where to delete/change the default “via @EventEspresso” part of the text. Any further suggestions? Thanks in advance. |
|
|
Hi, In the espresso-social/espresso-social.php file on line 297 it reads $button .= '" data-via="' . $espresso_twitter['espresso_twitter_username']; commenting this out or removing it will remove the via @EventEspresso. Please note that this is a core file so your changes will be over written when the plugin is updated. To stop that you could add the function espresso_twitter_button() to a custom plugin or custom functions file and edit it there as this function is Pluggable http://codex.wordpress.org/Pluggable_Functions |
Thank you Dean. That’s a great suggestion. I know how to create a custom plugin via: https://gist.github.com/joshfeck/6737395 …but what code should I paste into the custom plugin so that I can edit that out? Would it be just those two lines that you provided, or would I need to copy over the entire .php file? Please advise. Thank you. |
|
|
Hi, You should copy over the function outline below function espresso_twitter_button($event_id) { global $espresso_twitter; //Build the URl to the page $registration_url = espresso_reg_url($event_id); //get_option('siteurl') . '/?ee='. $event_id; // new button if (is_ssl()) { $button = '<a href="https://twitter.com/share"'; } else { $button = '<a href="http://twitter.com/share"'; } $button .= 'class="twitter-share-button" data-url="' . $registration_url; $button .= '" data-count="' . $espresso_twitter['espresso_twitter_count_box']; $button .= '" data-via="' . $espresso_twitter['espresso_twitter_username']; $button .= '" data-lang="' . $espresso_twitter['espresso_twitter_lang']; if (is_ssl()) { $button .= '">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>'; } else { $button .= '">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>'; } // all done! return $button; } That can then be edited accordingly. |
Thank you, Dean. I created a .php plugin and inserted the above code as per: http://ottopress.com/2011/creating-a-site-specific-snippets-plugin/ While the plugin file did show up in my plugin area, It did not activate when trying to activate it. Maybe I copied your function code wrong. What looks wrong below? <?php function espresso_twitter_button($event_id) { //Build the URl to the page // new button |
|
|
Hi Ronald, One of my colleagues pointed out a much simpler way to do this: In your Admin dashboard go to Event Espresso > Social Media > Twitter Settings and change the Twitter username… I must apologise for leading you up the wrong path with this, when a simple option change would have resolved it. |
No problem, Dean. I appreciate all of your help. Thank you to your colleague as well. That was much easier. I just deleted the username completely in the settings and now the tweet just shows my custom message and the class URL. Awesome! Case closed. |
|
The support post ‘Change the default Twitter/Facebook message?’ 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.