WordPress.org

Forums

Floating Social Media Links
[resolved] PHP (3 posts)

  1. Robbie_berns
    Member
    Posted 3 years ago #

    What a great and polished plugin - well done!

    Question: is there a way of putting PHP code into the links (eg <?php upm_save() ?>

    Many thanks
    ROB

    http://wordpress.org/extend/plugins/floating-social-media-links/

  2. Nick Halsey
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks!

    You pose an interesting question, this would require accessing the option from the database and executing it as PHP both on the server side, and I'm not sure that that's possible. If anyone has ideas I'd be happy to try to implement them in a future release. I could also try to add options for dynamic links, but they would need to be relatively general...

    You could, of course, edit the plugin files and add the PHP manually where the links are output (the very bottom of the main PHP file); you would need to put something into the link field on the options page too (such as a trailing /), and would need to re-implement after every update, but it's a workaround. You would need to be relatively familiar with PHP of course...

  3. Nick Halsey
    Member
    Plugin Author

    Posted 3 years ago #

    As of the just-released version 1.3.1, php-generated links are now possible, and quite easy. Use the custom output option, and then place:

    <?php floating_social_media_links([phplink1 or null],[phplink2 or null],[phplink3 or null]); ?>

    into each page template you want the frame on OR into footer.php (for display on every page). Links 1, 2, and 3 replace the first three custom links. Fill out the options page with the icon(s), link title(s), and checking the "show link" checkbox(es).

    The links will be sent to the function as the strings they return. Using "null" allows some extra flexibility for link order. The function does check for null values (and only replaces the link url field when the value isn't null), but doesn't do any additional checks, such as for a non-strings, WP_Error objects, etc. because of the wide range of possibilities. So I recommend running the necessary checks prior to passing the variable(s) to the function.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Floating Social Media Links
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.