Developers

Click & Tweet comes with hooks that allow developers to customize different aspects of the plugin.

Filter Hooks

These allow you to hook a function to specific filter actions.

Reference: https://codex.wordpress.org/Function_Reference/add_filter


click_and_tweet_content

This filter allows you to customize both the inline and tweet card content output. To use, add the following code to your functions.php file:

<?php

    /**
     * Click & Tweet Content
     *
     * @param string $content
     */

    function click_and_tweet_content_filter($content)
    {
        // manipulate $content to your specification.

        return $content;
    }

    add_filter( 'click_and_tweet_content', 'click_and_tweet_content_filter');

?>

Filter Hook


click_and_tweet_cta

Use this filter can to customize the call to action text on inline and card tweets. To use, add the following code to your functions.php file:

<?php

    /**
     * Filter the Click & Tweet Call to Action Text
     *
     * @param string $callToActionText
     */

    function click_and_tweet_cta_filter($callToActionText)
    {
        // manipulate $callToActionText to your specification.

        return $callToActionText;
    }

    add_filter( 'click_and_tweet_cta', 'click_and_tweet_cta_filter');

?>

Filter Hook


click_and_tweet_post_types

Use this filter to customize which post types you want the plugin to operate on. To use, add the following code to your functions.php file:

<?php

    /**
     * Filter the Click & Tweet Post Types
     *
     * @param string $postTypes
     */

    function click_and_tweet_pt($postTypes)
    {
        // manipulate $postTypes to add or remove post types from plugin configuration.

        return $postTypes = ['post', 'page'];
    }

    add_filter( 'click_and_tweet_pt', 'click_and_tweet_post_types');

?>

Filter Hook

Action Hooks

Coming Soon