WordPress.org

Support

Support » Plugins and Hacks » URL Shortener » [Resolved] [Plugin: URL Shortener] using the action hooks

[Resolved] [Plugin: URL Shortener] using the action hooks

Viewing 1 replies (of 1 total)
  • Plugin Author Gerald

    @geraldyeo

    An example usage of the hook

    function duplicate_field($post_id, $shortlink){
    	add_post_meta($post_id, 'duplicate', $shortlink);
    }
    add_action('fts_use_shortlink', 'duplicate_field', 10, 2)

    The above code snippet will add a second custom field with the shortlink as the value…

    So, if you want to add an action to post to twitter:

    function to_twitter($post_id, $shortlink){
    	/*your twitter functions here*/
    }
    add_action('fts_use_shortlink', 'to_twitter', 10, 2)

    For more about action hooks, check out:
    http://codex.wordpress.org/Function_Reference/add_action

    Do check the URL shortener wiki as well:
    http://wiki.fusedthought.com/docs/url-shortener-wordpress-plugin/v3
    I’ll try to expand the hook documentation in the future.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: URL Shortener] using the action hooks’ is closed to new replies.
Skip to toolbar