Plugin Directory

Changeset 768501


Ignore:
Timestamp:
09/08/2013 08:06:18 AM (12 years ago)
Author:
ArnaudBan
Message:

new version 0.5

Location:
widget-embed-lastest-tweets
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • widget-embed-lastest-tweets/tags/0.5/js/welt-scripts.js

    r668718 r768501  
    2020
    2121        jQuery.post(
    22             ajaxurl,
     22            weltAjaxurl,
    2323            data,
    2424            function(response) {
  • widget-embed-lastest-tweets/tags/0.5/readme.txt

    r691812 r768501  
    33Tags: twitter, widget, embed
    44Requires at least: 3
    5 Tested up to: 3.5.1
     5Tested up to: 3.6
    66Stable tag: trunk
    77License: GPLv2
     
    43431. Upload `/widget-embed-latest-tweets/` to the `/wp-content/plugins/` directory
    44442. Activate the plugin through the 'Plugins' menu in WordPress
    45 3. Go to the Widget page, drag and drop the "Widget embed lastest Tweets" widget where you want it to show
    46 4. Enter at least your Twitter username
     453. Visit the option page "Plugins->Widget Embed Latest Tweet" and follow the instructions
     464. Go to the Widget page, drag and drop the "Widget embed lastest Tweets" widget where you want it to show
     475. Enter at least your Twitter username
    4748
    4849== Frequently Asked Questions ==
     
    5960
    6061== Changelog ==
     62
     63= 0.5 =
     64
     65* French translation
     66* Welt's Scripts only when necessary
     67* Add a "setting" link on the plugins list page
    6168
    6269= 0.4.1 =
  • widget-embed-lastest-tweets/tags/0.5/welt-option.php

    r691812 r768501  
    3030            //Prints out all settings sections added to a particular settings page
    3131            do_settings_sections('welt_options_page');
     32
     33            submit_button();
    3234            ?>
    33             <p class="submit">
    34                 <input name="submit" type="submit" value="<?php _e('Save Changes'); ?>" class="button-primary menu-save" />
    35             </p>
    3635        </form>
    3736
     
    4948    //On créer une section dans nos options
    5049    //add_settings_section( $id, $title, $callback, $page );
    51     add_settings_section('welt_twitter_oauth_section', 'Twitter connection', 'welt_twitter_oauth_section_text', 'welt_options_page');
     50    add_settings_section('welt_twitter_oauth_section', __('Twitter connection', 'ab-welt-locales'), 'welt_twitter_oauth_section_text', 'welt_options_page');
    5251
    5352    //Register a settings field to a settings page and section.
  • widget-embed-lastest-tweets/tags/0.5/widget-embed-latest-tweets.php

    r691812 r768501  
    44 * Plugin URI: http://arnaudban.me/blog/portfolio/widget-embed-latest-tweets/
    55 * Description: A Widget to show your latest Tweets. Use the oEmbed methode and some cache. Visit the option page "Plugins->Widget Embed Last Plugin" to authentify yourself
    6  * Version: 0.4.1
     6 * Version: 0.5
    77 * Author: Arnaud Banvillet
    88 * Author URI: http://arnaudban.me
     
    6262    public function widget($args, $instance) {
    6363
     64        wp_enqueue_script('welt_script');
     65        wp_localize_script( 'welt_script', 'weltAjaxurl', admin_url('admin-ajax.php') );
     66
     67
    6468        $instance = wp_parse_args($instance, $this->defaut);
    6569
     
    156160            <input id="<?php echo $this->get_field_id('maxwidth'); ?>" name="<?php echo $this->get_field_name('maxwidth'); ?>" type="number" step="1" min="250" max="550" value="<?php echo $maxwidth; ?>" />
    157161            <br />
    158             <span class="description"><?php _e('Twitter says :This value is constrained to be between 250 and 550 pixels') ?></span>
     162            <span class="description"><?php _e('Twitter says :This value is constrained to be between 250 and 550 pixels', 'ab-welt-locales') ?></span>
    159163
    160164        </p>
     
    193197            <input id="<?php echo $this->get_field_id('lang'); ?>" name="<?php echo $this->get_field_name('lang'); ?>" type="text" value="<?php echo $lang; ?>" size="2"/>
    194198            <br />
    195             <span class="description"><?php _e('Two firsts caractere only. Example : "fr" for french') ?></span>
     199            <span class="description"><?php _e('Two firsts caractere only. Example : "fr" for french', 'ab-welt-locales') ?></span>
    196200        </p>
    197201        <?php
     
    328332function welt_enqueue_scripts(){
    329333    // welt
    330     wp_enqueue_script('welt_script', plugins_url('/js/welt-scripts.js', __FILE__) , array( 'jquery' ), '20130129', true );
    331     wp_localize_script( 'welt_script', 'ajaxurl', admin_url('admin-ajax.php') );
     334    wp_register_script('welt_script', plugins_url('/js/welt-scripts.js', __FILE__) , array( 'jquery' ), '20130129', true );
    332335
    333336}
    334337add_action('wp_enqueue_scripts', 'welt_enqueue_scripts');
    335338
    336 //Files needed for the Twitter authentification
    337 //Check if TwitterOAuth doesn't already existe
    338 if( ! class_exists( 'TwitterOAuth' )){
    339 
    340     require_once 'twitteroauth/twitteroauth.php';
    341 
    342 }
    343 
     339function welt_plugin_init() {
     340
     341    //Files needed for the Twitter authentification
     342    //Check if TwitterOAuth doesn't already existe
     343    if( ! class_exists( 'TwitterOAuth' )){
     344
     345        require_once 'twitteroauth/twitteroauth.php';
     346
     347    }
     348
     349  load_plugin_textdomain( 'ab-welt-locales', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     350}
     351add_action('plugins_loaded', 'welt_plugin_init');
     352
     353
     354// Option page
    344355require_once 'welt-option.php';
     356
     357
     358// Add settings link on plugin page
     359function welt_add_settings_link($links) {
     360  $settings_link = '<a href="plugins.php?page=welt_options_page">' . __('Settings') . '</a>';
     361  array_unshift($links, $settings_link);
     362  return $links;
     363}
     364
     365$plugin = plugin_basename(__FILE__);
     366add_filter("plugin_action_links_$plugin", 'welt_add_settings_link' );
  • widget-embed-lastest-tweets/trunk/js/welt-scripts.js

    r668718 r768501  
    2020
    2121        jQuery.post(
    22             ajaxurl,
     22            weltAjaxurl,
    2323            data,
    2424            function(response) {
  • widget-embed-lastest-tweets/trunk/readme.txt

    r691812 r768501  
    33Tags: twitter, widget, embed
    44Requires at least: 3
    5 Tested up to: 3.5.1
     5Tested up to: 3.6
    66Stable tag: trunk
    77License: GPLv2
     
    43431. Upload `/widget-embed-latest-tweets/` to the `/wp-content/plugins/` directory
    44442. Activate the plugin through the 'Plugins' menu in WordPress
    45 3. Go to the Widget page, drag and drop the "Widget embed lastest Tweets" widget where you want it to show
    46 4. Enter at least your Twitter username
     453. Visit the option page "Plugins->Widget Embed Latest Tweet" and follow the instructions
     464. Go to the Widget page, drag and drop the "Widget embed lastest Tweets" widget where you want it to show
     475. Enter at least your Twitter username
    4748
    4849== Frequently Asked Questions ==
     
    5960
    6061== Changelog ==
     62
     63= 0.5 =
     64
     65* French translation
     66* Welt's Scripts only when necessary
     67* Add a "setting" link on the plugins list page
    6168
    6269= 0.4.1 =
  • widget-embed-lastest-tweets/trunk/welt-option.php

    r691812 r768501  
    3030            //Prints out all settings sections added to a particular settings page
    3131            do_settings_sections('welt_options_page');
     32
     33            submit_button();
    3234            ?>
    33             <p class="submit">
    34                 <input name="submit" type="submit" value="<?php _e('Save Changes'); ?>" class="button-primary menu-save" />
    35             </p>
    3635        </form>
    3736
     
    4948    //On créer une section dans nos options
    5049    //add_settings_section( $id, $title, $callback, $page );
    51     add_settings_section('welt_twitter_oauth_section', 'Twitter connection', 'welt_twitter_oauth_section_text', 'welt_options_page');
     50    add_settings_section('welt_twitter_oauth_section', __('Twitter connection', 'ab-welt-locales'), 'welt_twitter_oauth_section_text', 'welt_options_page');
    5251
    5352    //Register a settings field to a settings page and section.
  • widget-embed-lastest-tweets/trunk/widget-embed-latest-tweets.php

    r691812 r768501  
    44 * Plugin URI: http://arnaudban.me/blog/portfolio/widget-embed-latest-tweets/
    55 * Description: A Widget to show your latest Tweets. Use the oEmbed methode and some cache. Visit the option page "Plugins->Widget Embed Last Plugin" to authentify yourself
    6  * Version: 0.4.1
     6 * Version: 0.5
    77 * Author: Arnaud Banvillet
    88 * Author URI: http://arnaudban.me
     
    6262    public function widget($args, $instance) {
    6363
     64        wp_enqueue_script('welt_script');
     65        wp_localize_script( 'welt_script', 'weltAjaxurl', admin_url('admin-ajax.php') );
     66
     67
    6468        $instance = wp_parse_args($instance, $this->defaut);
    6569
     
    156160            <input id="<?php echo $this->get_field_id('maxwidth'); ?>" name="<?php echo $this->get_field_name('maxwidth'); ?>" type="number" step="1" min="250" max="550" value="<?php echo $maxwidth; ?>" />
    157161            <br />
    158             <span class="description"><?php _e('Twitter says :This value is constrained to be between 250 and 550 pixels') ?></span>
     162            <span class="description"><?php _e('Twitter says :This value is constrained to be between 250 and 550 pixels', 'ab-welt-locales') ?></span>
    159163
    160164        </p>
     
    193197            <input id="<?php echo $this->get_field_id('lang'); ?>" name="<?php echo $this->get_field_name('lang'); ?>" type="text" value="<?php echo $lang; ?>" size="2"/>
    194198            <br />
    195             <span class="description"><?php _e('Two firsts caractere only. Example : "fr" for french') ?></span>
     199            <span class="description"><?php _e('Two firsts caractere only. Example : "fr" for french', 'ab-welt-locales') ?></span>
    196200        </p>
    197201        <?php
     
    328332function welt_enqueue_scripts(){
    329333    // welt
    330     wp_enqueue_script('welt_script', plugins_url('/js/welt-scripts.js', __FILE__) , array( 'jquery' ), '20130129', true );
    331     wp_localize_script( 'welt_script', 'ajaxurl', admin_url('admin-ajax.php') );
     334    wp_register_script('welt_script', plugins_url('/js/welt-scripts.js', __FILE__) , array( 'jquery' ), '20130129', true );
    332335
    333336}
    334337add_action('wp_enqueue_scripts', 'welt_enqueue_scripts');
    335338
    336 //Files needed for the Twitter authentification
    337 //Check if TwitterOAuth doesn't already existe
    338 if( ! class_exists( 'TwitterOAuth' )){
    339 
    340     require_once 'twitteroauth/twitteroauth.php';
    341 
    342 }
    343 
     339function welt_plugin_init() {
     340
     341    //Files needed for the Twitter authentification
     342    //Check if TwitterOAuth doesn't already existe
     343    if( ! class_exists( 'TwitterOAuth' )){
     344
     345        require_once 'twitteroauth/twitteroauth.php';
     346
     347    }
     348
     349  load_plugin_textdomain( 'ab-welt-locales', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
     350}
     351add_action('plugins_loaded', 'welt_plugin_init');
     352
     353
     354// Option page
    344355require_once 'welt-option.php';
     356
     357
     358// Add settings link on plugin page
     359function welt_add_settings_link($links) {
     360  $settings_link = '<a href="plugins.php?page=welt_options_page">' . __('Settings') . '</a>';
     361  array_unshift($links, $settings_link);
     362  return $links;
     363}
     364
     365$plugin = plugin_basename(__FILE__);
     366add_filter("plugin_action_links_$plugin", 'welt_add_settings_link' );
Note: See TracChangeset for help on using the changeset viewer.