[animated-twitter-slideshow] shortcode in your content section. To add directly to your php template code add echo do_shortcode(\'[animated-twitter-slideshow]\'); directly to the portion of the template you wish to display in.', 'animated-twitter-slideshow' ), 'update-nag' );
?>
';
echo '
';
foreach((array)$wp_settings_sections[$page] as $section) {
if(!isset($section['title']))
continue;
printf('
';
}
echo '';
}
/**
* function atsRegisterPlugInFields
*/
public function atsRegisterPlugInFields() {
//Register Settings Group
register_setting( 'ats-settings-group', 'ats-settings' );
//Register Settings Sections
add_settings_section( 'ats-twitter-users-section', __( 'Twitter User to Follow', 'textdomain' ), array( $this, 'atsUsersSectionCallback' ), 'ats-settings' );
add_settings_section( 'ats-twitter-display-section', __( 'Slideshow Settings', 'textdomain' ), array( $this, 'atsDisplaySectionCallback' ), 'ats-settings' );
add_settings_section( 'ats-twitter-cache-section', __( 'Cache Settings', 'textdomain' ), array( $this, 'atsCacheSectionCallback' ), 'ats-settings' );
add_settings_section( 'ats-twitter-auth-section', __( 'Twitter Authorization Settings', 'textdomain' ), array( $this, 'atsAuthSectionCallback' ), 'ats-settings' );
//Display Section Fields Register
add_settings_field( 'ats-api-key', __( 'Twitter Consumer Key (API Key)', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-auth-section', $args=array('name'=>'ats-api-key', 'type'=>'text', 'instructions'=>'Enter the Consumer Key for your registered Twitter application. Go to Apps.Twitter.com and follow the instructions from the readme.txt to setup your API Key and Secret below.') );
add_settings_field( 'ats-api-secret', __( 'Twitter Consumer Secret (API Secret)', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-auth-section', $args=array('name'=>'ats-api-secret', 'type'=>'text', 'instructions'=>'Enter the Consumer Secret for your registered Twitter application (see readme.txt).') );
add_settings_field( 'ats-api-unlock', __( 'Re-Enter Twitter API Key/Secret', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-auth-section', $args=array('name'=>'ats-api-unlock', 'type'=>'api-unlock', 'instructions'=>'Re-Enter the Twitter API key/secret values above. Do this if the plugin is having trouble with authorization.') );
add_settings_field( 'ats-twitter-users-field', __( 'Twitter User', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-users-section', $args=array('name'=>'ats-twitter-users-field', 'type'=>'text', 'instructions'=>'Enter the Twitter User to follow screen-name above. (example: @wholahoopmedia).') );
add_settings_field( 'ats-tweet-count', __( 'Max Tweets to Display', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-display-section', $args=array('name'=>'ats-tweet-count', 'type'=>'select', 'items'=>array("1","2","3","4","5","6","7","8","9","10"), 'instructions'=>'Enter the maximum number of tweets (slides) to display. The actual number displayed may be lower due to Twitters calculations, and the Twitter users retweets.') );
add_settings_field( 'ats-slideshow-delay', __( 'Slideshow Delay', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-display-section', $args=array('name'=>'ats-slideshow-delay', 'type'=>'select', 'items'=>array("4","5","6","7","8","9","10"), 'instructions' =>'Select the slideshow delay in seconds.' ) );
add_settings_field( 'ats-cache-timer', __( 'Set Twitter API Cache', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-cache-section', $args=array('name'=>'ats-cache-timer', 'type'=>'select', 'items'=>array("15","30","45","60"), 'instructions' =>'Select the cache hold for the Twitter API in minutes. This value ensures that you will not make too many calls to the Twitter API server.' ) );
add_settings_field( 'ats-clear-cache', __( 'Clear Twitter API Cache', 'textdomain' ), array( $this, 'atsPlugInFieldCreate' ), 'ats-settings', 'ats-twitter-cache-section', $args=array('name'=>'ats-clear-cache', 'type'=>'clear-cache', 'instructions' =>'Clear the current cache of Twitter tweet responses. This is automatically done when you change/add/remove twitter users to follow. Do this if you are troubleshooting.' ) );
}
/**
* Admin Settings Sections Callbacks
*/
public function atsUsersSectionCallback() {
_e( '', 'textdomain' );
}
public function atsDisplaySectionCallback() {
_e( 'Enter all slideshow settings below.', 'textdomain' );
}
public function atsAuthSectionCallback() {
_e( 'Enter your created Twitter App information below.', 'textdomain' );
}
public function atsCacheSectionCallback() {
_e( 'Select the Caching settings for the Twitter feeds below. Setting a higher time for caching will make less calls to the Twitter API Server and make sure you do not go over their limits.', 'textdomain' );
}
/**
* function atsPlugInFieldCreate
* params: array( string $name, string $type, (opt) array $items, (opt) string $instructions )
*
*/
public function atsPlugInFieldCreate( $args ) {
$settings = (array) get_option( 'ats-settings' );
$field = $args['name'];
$value = esc_attr( $settings[$field] );
if( isset( $args['items'] ) ) { $items = $args['items']; }
//switch on field input type
switch ($args['type']) {
case 'text' :
echo "";
break;
case 'select' :
echo "";
break;
case 'clear-cache' :
echo('');
break;
case 'api-unlock' :
echo('');
break;
}
//add instructions if needed
if( isset( $args['instructions'] ) ) {
$instructions = $args['instructions'];
echo "