Warning: Invalid argument supplied for foreach() in /home/creoworx/public_html/docs_socialsharingplugin/wp-content/plugins/creoworx-taxonomy-icons/lib/better-font-awesome-library/better-font-awesome-library.php on line 875
How to Create an Automatic Share Buttons Display Method Using Existing Actions or Filters? - Easy Social Share Buttons Documentation

    Introduction

    Easy Social Share Buttons for WordPress has more than 30 automatic display methods included but that sometimes is not enough. To provide maximum flexibility we introduce the one of a kind integration menu for creating a custom display positions. The integration menu allows to create a display position for share buttons (like the build inside plugin) associated to an action or filter supported by your theme (or plugin you are using). With the integration menu you can also create a theme integration point. That theme integration for share buttons will work like other methods that you can use (with shortcode or function call) but it will appear inside the display positions of plugin and it will have all the visual options that each location has.

    The most important advantage of using developer tools integration to create a custom display method for share buttons is that it will work like all existing display methods. Whenever you need to stop share buttons from appearing or change the style you can visit and do this like all other methods – no need to edit code.

    How to Activate Custom Hook Integrations

    To activate the custom hook integrations inside plugin you need to open Manage Plugin Features -> Developer Functions and set to Yes option for Activate filter/actions integration. When you do this save the settings and reload page – you will see a new menu appearing “Developer Tools” where all integration options are present.

    How to Create a New Integration Point

    To create a new integration point you need to open Developer Tools menu and fill all the fields inside the screen with proper information. Inside this screen you will see also all existing integrations you have already made with option to edit or remove.

    • Integration ID – this is an unique ID which plugin will use to identify the appearance of buttons and run the code. We recommend if you do a filter/action integration to fill in the filter or action in here. If you duplicate and ID the previous integration will be removed so fill it with caution. For ID use only latin characters and numbers (no special characters or spaces).
    • Integration Name – this is the name you will see inside Display Positions and Display Position Settings. Set something that will help you identify it fast but please do not fill a too long text
    • Integration Type – with selection here you choose how the position will work. If you do an integration for an action or filter that comes with theme/plugin select the appropriate value from menu. If you are doing a custom theme integration point than you need to choose “Custom Position”
    • Action/filter name – that field is require only if you are doing a theme/plugin action or filter integration. Inside this field you need to set the action/filter name that will be used exactly as you see it inside the connecting plugin/theme

    If you select to make a custom position inside the integration menu than you need to include the following code where you need share buttons to appear (replace integration_id with your ID you fill when creating the custom position):

    <?php if (function_exists("essb_hook_integration_draw")) { essb_hook_integration_draw("integration_id"); } ?>

    Example: Integrating Automatic Share Button Appearance in WooCommerce Shop or Archive Page

    To illustrate how easy is to integrate buttons we will give you a real life example used by many of our customers. With that setup you can easy show share buttons on your shop list page or archive (category) pages like the screenshot below.

    To do this inside the integration menu you need to select the following options:

    • Integration ID – woocommerce_after_shop_loop_item
    • Integration Name – Show Share Buttons on Shop Pages
    • Integration Type – Action
    • Action/filter name – woocommerce_after_shop_loop_item

    When you save the settings you will be able to activate the integration from display positions when you need to show share buttons:

    You will also have a full set of customization options like all other display positions where you can change active social networks and all other design time options

    Was this article helpful?

    2
    You already voted this article!