htmlburger / twitter-helper
Helper library for retrieving information from the Twitter API.
v1.0.2
2016-06-27 11:07 UTC
Requires
- htmlburger/carbon-fields: 1.1.*
This package is auto-updated.
Last update: 2024-10-29 04:53:06 UTC
README
Helper library for retrieving information from the Twitter API.
Theme Options
This plugin requires the following Theme Options
:
if ( function_exists('carbon_twitter_widget_registered') && carbon_twitter_widget_registered() ) {
Container::make('theme_options', 'Twitter Settings')
->set_page_parent(__('Theme Options', 'crb'))
->add_fields(array(
Field::make('html', 'crb_twitter_settings_html')
->set_html('
<div style="position: relative; background: #fff; border: 1px solid #ccc; padding: 10px;">
<h4><strong>' . __('Twitter API requires a Twitter application for communication with 3rd party sites. Here are the steps for creating and setting up a Twitter application:', 'crb') . '</strong></h4>
<ol style="font-weight: normal;">
<li>' . sprintf(__('Go to <a href="%1$s" target="_blank">%1$s</a> and log in, if necessary.', 'crb'), 'https://dev.twitter.com/apps/new') . '</li>
<li>' . __('Supply the necessary required fields and accept the <strong>Terms of Service</strong>. <strong>Callback URL</strong> field may be left empty.', 'crb') . '</li>
<li>' . __('Submit the form.', 'crb') . '</li>
<li>' . __('On the next screen, click on the <strong>Keys and Access Tokens</strong> tab.', 'crb') . '</li>
<li>' . __('Scroll down to <strong>Your access token</strong> section and click the <strong>Create my access token</strong> button.', 'crb') . '</li>
<li>' . __('Copy the following fields: <strong>Consumer Key, Consumer Secret, Access Token, Access Token Secret</strong> to the below fields.', 'crb') . '</li>
</ol>
</div>
'),
Field::make('text', 'crb_twitter_consumer_key', __('Consumer Key', 'crb'))
->set_default_value(''),
Field::make('text', 'crb_twitter_consumer_secret', __('Consumer Secret', 'crb'))
->set_default_value(''),
Field::make('text', 'crb_twitter_oauth_access_token', __('Access Token', 'crb'))
->set_default_value(''),
Field::make('text', 'crb_twitter_oauth_access_token_secret', __('Access Token Secret', 'crb'))
->set_default_value(''),
));
}