• Resolved Jeremy

    (@thornbrand)


    Hi, Robin. Thank you for this fantastic plugin and your time! Much appreciated.

    I’m currently using custom fields and meta boxes on the post editor to select locations, buttons and headings. Then gather the info and assemble a shortcode to output to the necessary theme hooks. It works great, and allows me to select locations, buttons and headings on a per post/page basis. But I’d like to move away from using do_shortcode, and lean up the code I have running on each page load.

    Is there a filter or function available to select which buttons are output? I’ve found the scriptlesssocialsharing_do_buttons helper function, but it doesn’t appear that I can filter which buttons are output.

    My current PHP knowledge is intermediate, at best, so I may be missing something obvious. I’m learning as I go. =)

    Thanks again!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    The scriptlesssocialsharing_buttons filter (ref) returns an array of buttons available for output, so I would think you could use that and return only the buttons selected in your post meta. Otherwise, the plugin expects to just output the buttons selected on the main settings page.

    The exception to that is the shortcode (and now block), which does allow you to very selectively modify the heading and buttons at the point of output. If this is your goal, I don’t know that moving away from do_shortcode will make your life easier; I think it’s likely the easiest way to manage extensive customization.

    Thread Starter Jeremy

    (@thornbrand)

    Thanks so much, Robin. I will play around with the filter and see what I can do.

    I think you are correct though, and I really appreciate your experience and feedback as well. My current implementation is working great and doing exactly what I need. At this point, I’m really just exploring as a learning exercise. Every time I think I understand the best way to accomplish something, I discover a new approach or method I was unaware of.

    Thanks again and have a great day!

    Plugin Author Robin Cornett

    (@littlerchicken)

    As a fellow tinkerer, I completely understand. Best of luck as you poke around and thank you for asking!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Selecting Buttons for Output’ is closed to new replies.