Changeset 1105561
- Timestamp:
- 03/05/2015 12:30:49 AM (11 years ago)
- Location:
- twitter/trunk
- Files:
-
- 2 added
- 1 deleted
- 16 edited
-
compatibility-notice.php (added)
-
readme.txt (modified) (3 diffs)
-
src/Twitter/Intents/Tweet.php (modified) (1 diff)
-
src/Twitter/WordPress/Admin/Post/MetaBox.php (modified) (1 diff)
-
src/Twitter/WordPress/Admin/Post/TweetIntent.php (modified) (2 diffs)
-
src/Twitter/WordPress/Admin/Post/TwitterCard.php (modified) (2 diffs)
-
src/Twitter/WordPress/Admin/Settings/Loader.php (modified) (1 diff)
-
src/Twitter/WordPress/Admin/Settings/SettingsSection.php (added)
-
src/Twitter/WordPress/Admin/Settings/SinglePage.php (modified) (3 diffs)
-
src/Twitter/WordPress/Admin/Settings/SiteAttribution.php (modified) (1 diff)
-
src/Twitter/WordPress/Admin/Settings/Template.php (deleted)
-
src/Twitter/WordPress/Admin/Settings/Theme.php (modified) (3 diffs)
-
src/Twitter/WordPress/Admin/Settings/TweetButton.php (modified) (1 diff)
-
src/Twitter/WordPress/Content/TweetButton.php (modified) (2 diffs)
-
src/Twitter/WordPress/PluginLoader.php (modified) (3 diffs)
-
src/Twitter/WordPress/Shortcodes/Share.php (modified) (1 diff)
-
src/Twitter/WordPress/Widgets/Follow.php (modified) (1 diff)
-
static/css/admin/post/edit.min.css (modified) (1 diff)
-
twitter.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
twitter/trunk/readme.txt
r1101341 r1105561 4 4 Requires at least: 3.9 5 5 Tested up to: 4.1 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 License: MIT 8 8 License URI: http://opensource.org/licenses/MIT 9 9 10 Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.4 or newer.10 Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.4 or greater. 11 11 12 12 == Description == … … 14 14 The Twitter plugin for WordPress optimizes your website for a Twitter audience through easy to use sharing buttons, embedded Tweets, auto-generated markup indexed by Twitter, and Follow buttons to help grow your Twitter audience. All features are deeply integrated with WordPress APIs to make building your webpages and administrative features as easy as possible with the extensibility you expect from WordPress. 15 15 16 Requires PHP 5.4 or later.16 Requires PHP version 5.4 or greater. 17 17 18 18 * [Embedded Tweet](https://dev.twitter.com/web/embedded-tweets) - customize backgrounds and color schemes to match your site's theme … … 26 26 Contribute to the plugin, submit pull requests, or run test suites through the [Twitter plugin for WordPress GitHub repository](https://github.com/twitter/wordpress). View [Twitter for WordPress documentation](https://dev.twitter.com/web/wordpress) to learn more about customization through filters. 27 27 28 == Upgrade Notice == 29 30 = 1.0.1 = 31 32 Display admin notice if current PHP version does not meet minimum requirements. Do not display Tweet button in auto-generated excerpt. 33 28 34 == Changelog == 35 36 = 1.0.1 = 37 * Display admin notice if plugin is installed on a site not meeting minimum PHP requirement 38 * Disable Tweet button the_content wrapper when called during excerpt generation 39 * Tweet button: add support for via shortcode attribute 40 * Fix: save Follow button widget with no overrides 29 41 30 42 = 1.0.0 = -
twitter/trunk/src/Twitter/Intents/Tweet.php
r1099428 r1105561 281 281 { 282 282 return array_values($this->hashtags); 283 } 284 285 /** 286 * Get the stored via value 287 * 288 * @since 1.0.1 289 * 290 * @return string source Twitter account username 291 */ 292 public function getVia() 293 { 294 return $this->via ?: ''; 283 295 } 284 296 -
twitter/trunk/src/Twitter/WordPress/Admin/Post/MetaBox.php
r1099428 r1105561 146 146 ), // absolute URI 147 147 array(), // no dependencies 148 '1.0. 0' // last chance. used for caching148 '1.0.1' // last change. used for caching 149 149 ); 150 150 } -
twitter/trunk/src/Twitter/WordPress/Admin/Post/TweetIntent.php
r1099428 r1105561 165 165 166 166 echo '<tr>'; 167 echo '<t dscope="row" class="left"><label for="tweet-text">' . esc_html( _x( 'Text', 'Share / Tweet text', 'twitter' ) ) . '</label></th>';167 echo '<th scope="row" class="left"><label for="tweet-text">' . esc_html( _x( 'Text', 'Share / Tweet text', 'twitter' ) ) . '</label></th>'; 168 168 echo '<td><input id="tweet-text" name="' . esc_attr( static::META_KEY . '[' . static::TEXT_KEY . ']' ) . '" type="text" maxlength="' . $available_characters . '" autocomplete="off"'; 169 169 if ( isset( $stored_values[ static::TEXT_KEY ] ) ) { … … 175 175 echo '</tr>'; 176 176 echo '<tr>'; 177 echo '<t d scope="row" class="left"><label for"tweet-hashtags">' . esc_html( __( 'Hashtags', 'twitter' ) ) . '</label></th>';177 echo '<th scope="row" class="left"><label for="tweet-hashtags">' . esc_html( __( 'Hashtags', 'twitter' ) ) . '</label></th>'; 178 178 echo '<td><input id="tweet-hashtags" name="' . esc_attr( static::META_KEY . '[' . static::HASHTAGS_KEY . ']' ) . '" type="text" maxlength="' . ($available_characters - 2) . '" autocomplete="off"'; 179 179 if ( isset( $stored_values[ static::HASHTAGS_KEY ] ) && is_array( $stored_values[ static::HASHTAGS_KEY ] ) ) { -
twitter/trunk/src/Twitter/WordPress/Admin/Post/TwitterCard.php
r1099428 r1105561 143 143 144 144 echo '<tr>'; 145 echo '<t dscope="row" class="left"><label for="twitter-card-title">' . esc_html( __( 'Title' ) ) . '</label></th>';145 echo '<th scope="row" class="left"><label for="twitter-card-title">' . esc_html( __( 'Title' ) ) . '</label></th>'; 146 146 echo '<td><input type="text" id="twitter-card-title" name="' . esc_attr( static::META_KEY . '[' . static::TITLE_KEY . ']' ) . '" maxlength="70" autocomplete="off"'; 147 147 if ( isset( $stored_values[ static::TITLE_KEY ] ) ) { … … 157 157 if ( isset( $cards_fields_supported_by_post_type[ static::DESCRIPTION_KEY ] ) ) { 158 158 echo '<tr>'; 159 echo '<t dscope="row" class="left"><label for="twitter-card-description">' . esc_html( __( 'Description' ) ) . '</label></th>';159 echo '<th scope="row" class="left"><label for="twitter-card-description">' . esc_html( __( 'Description' ) ) . '</label></th>'; 160 160 echo '<td><input type="text" id="twitter-card-description" name="' . esc_attr( static::META_KEY . '[' . static::DESCRIPTION_KEY . ']' ) . '" maxlength="200" autocomplete="off"'; 161 161 if ( isset( $stored_values[ static::DESCRIPTION_KEY ] ) ) { -
twitter/trunk/src/Twitter/WordPress/Admin/Settings/Loader.php
r1099428 r1105561 42 42 public static function init() 43 43 { 44 add_action( 'admin_menu', array( __CLASS__, 'settingsMenuItems' ) );44 add_action( 'admin_menu', array( '\Twitter\WordPress\Admin\Settings\SinglePage', 'menuItem' ) ); 45 45 add_filter( 'plugin_action_links', array( __CLASS__, 'pluginActionLinks' ), 10, 2 ); 46 }47 48 /**49 * Add Twitter settings to the WordPress administration menu.50 *51 * @since 1.0.052 *53 * @return void54 */55 public static function settingsMenuItems()56 {57 \Twitter\WordPress\Admin\Settings\SinglePage::menuItem();58 46 } 59 47 -
twitter/trunk/src/Twitter/WordPress/Admin/Settings/SinglePage.php
r1099428 r1105561 33 33 class SinglePage 34 34 { 35 use Template;36 37 35 /** 38 36 * Settings page identifier. … … 120 118 121 119 /** 120 * Load the settings page 121 * 122 * @since 1.0.0 123 * 124 * @return void 125 */ 126 public function settingsPage() 127 { 128 if ( ! isset( $this->hook_suffix ) ) { 129 return; 130 } 131 132 do_action( 'add-' . $this->hook_suffix . '-section' ); 133 134 echo '<div class="wrap">'; 135 136 echo '<header><h2>' . esc_html( static::featureName() ) . '</h2></header>'; 137 // handle general messages such as settings updated up top 138 // place individual settings errors alongside their fields 139 settings_errors( 'general' ); 140 141 echo '<form method="post" action="' . esc_url( admin_url( 'options.php' ), array( 'https', 'http' ) ) . '">'; 142 settings_fields( $this->hook_suffix ); 143 do_settings_sections( $this->hook_suffix ); 144 submit_button(); 145 echo '</form>'; 146 147 echo '</div>'; 148 } 149 150 /** 122 151 * Add contextual help content to the settings screen 123 152 * … … 129 158 { 130 159 $screen = get_current_screen(); 131 if ( ! $screen ) { // null if global not set 160 // null if global not set 161 if ( ! $screen ) { 132 162 return; 133 163 } -
twitter/trunk/src/Twitter/WordPress/Admin/Settings/SiteAttribution.php
r1099428 r1105561 31 31 * @since 1.0.0 32 32 */ 33 class SiteAttribution 33 class SiteAttribution implements SettingsSection 34 34 { 35 35 /** -
twitter/trunk/src/Twitter/WordPress/Admin/Settings/Theme.php
r1099428 r1105561 31 31 * @since 1.0.0 32 32 */ 33 class Theme 33 class Theme implements SettingsSection 34 34 { 35 35 /** … … 158 158 add_action( 159 159 'add-' . $this->hook_suffix . '-section', 160 array( &$this, 'define ThemeSection' ),160 array( &$this, 'defineSection' ), 161 161 static::SECTION_PRIORITY, // top of screen 162 162 0 // no parameters … … 188 188 * @return void 189 189 */ 190 public function define ThemeSection()190 public function defineSection() 191 191 { 192 192 $section = 'twitter-colorscheme'; -
twitter/trunk/src/Twitter/WordPress/Admin/Settings/TweetButton.php
r1099428 r1105561 31 31 * @since 1.0.0 32 32 */ 33 class TweetButton 33 class TweetButton implements SettingsSection 34 34 { 35 35 /** -
twitter/trunk/src/Twitter/WordPress/Content/TweetButton.php
r1099428 r1105561 33 33 class TweetButton 34 34 { 35 36 35 /** 37 36 * Get the stored site option for Tweet button content … … 60 59 public static function contentFilter( $content ) 61 60 { 61 // do not include Tweet button(s) in an autogenerated excerpt 62 // get_the_excerpt filter calls wp_trim_excerpt() at priority 10 which triggers the_content filter on an empty excerpt string 63 if ( doing_filter( 'get_the_excerpt' ) ) { 64 return $content; 65 } 66 62 67 $options = static::getOption(); 63 68 if ( isset( $options['position'] ) ) { -
twitter/trunk/src/Twitter/WordPress/PluginLoader.php
r1099428 r1105561 42 42 * @type string 43 43 */ 44 const VERSION = '1.0. 0';44 const VERSION = '1.0.1'; 45 45 46 46 /** … … 121 121 static::TEXT_DOMAIN, 122 122 false, // deprecated parameter as of WP 2.7 123 dirname( plugin_basename( static::getPluginMainFile() ) ) . '/languages /' // directory location of MO files123 dirname( plugin_basename( static::getPluginMainFile() ) ) . '/languages' // directory location of MO files 124 124 ); 125 125 } … … 181 181 } 182 182 183 $twitter_content_priority = apply_filters( 'twitter_content_filter_priority', 10 ); 183 /** 184 * Set the priority to apply to Twitter elements automatically added to the_content 185 * 186 * Allow publishers to adjust the order of Twitter buttons relative to other the_content actors 187 * 188 * @since 1.0.0 189 * 190 * @param int $priority filter priority 191 */ 192 $twitter_content_priority = apply_filters( 'twitter_content_filter_priority', 15 ); 193 194 // possibly add Tweet button(s) 184 195 add_filter( 185 196 'the_content', -
twitter/trunk/src/Twitter/WordPress/Shortcodes/Share.php
r1099428 r1105561 197 197 } 198 198 unset( $intent ); 199 } 200 201 if ( isset( $attributes['via'] ) ) { 202 $via = (new \Twitter\Intents\Tweet())->setVia( $attributes['via'] )->getVia(); 203 if ( $via ) { 204 $options['via'] = $via; 205 } 206 unset( $via ); 199 207 } 200 208 -
twitter/trunk/src/Twitter/WordPress/Widgets/Follow.php
r1099428 r1105561 178 178 179 179 $filtered_options = $follow_button->toArray( /* dashed_keys */ false ); 180 if ( empty( $filtered_options ) ) {181 return false;182 }183 180 $screen_name = $follow_button->getScreenName(); 184 181 if ( $screen_name ) { -
twitter/trunk/static/css/admin/post/edit.min.css
r1099428 r1105561 1 #twitter-custom table{margin:0;width:100%;border:1px solid #dfdfdf;border-spacing:0;background-color:#f9f9f9}#twitter-custom thead th{padding:5px 8px 8px;background-color:#f1f1f1}#twitter-custom input{width:96%;margin:8px}#tweet-intent{width:100%}#twitter-card{width:100%}1 #twitter-custom table{margin:0;width:100%;border:1px solid #dfdfdf;border-spacing:0;background-color:#f9f9f9}#twitter-custom thead th{padding:5px 8px 8px;background-color:#f1f1f1}#twitter-custom tbody th{font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;text-align:inherit}#twitter-custom input{width:96%;margin:8px}#tweet-intent{width:100%}#twitter-card{width:100%} -
twitter/trunk/twitter.php
r1101341 r1105561 1 1 <?php 2 /**3 * @package twitter4 * @version 1.0.05 */6 /*7 Plugin Name: Twitter8 Plugin URI: http://wordpress.org/plugins/twitter/9 Description: Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.4 or newer.10 Version: 1.0.011 Author: Twitter12 Author URI: https://dev.twitter.com/13 License: MIT14 Text Domain: twitter15 Domain Path: /languages/16 */17 18 2 /* 19 3 The MIT License (MIT) … … 39 23 THE SOFTWARE. 40 24 */ 41 25 /** 26 * @package twitter 27 * @version 1.0.1 28 */ 29 /* 30 Plugin Name: Twitter 31 Plugin URI: http://wordpress.org/plugins/twitter/ 32 Description: Official Twitter plugin for WordPress. Embed Twitter content and grow your audience on Twitter. Requires PHP 5.4 or greater. 33 Version: 1.0.1 34 Author: Twitter 35 Author URI: https://dev.twitter.com/ 36 License: MIT 37 Text Domain: twitter 38 Domain Path: /languages/ 39 */ 42 40 43 41 // make sure the plugin does not expose any info if called directly … … 53 51 } 54 52 55 // plugin requires PHP 5.4 or newer53 // plugin requires PHP 5.4 or greater 56 54 if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) { 57 trigger_error( 'The Twitter plugin for WordPress requires PHP version 5.4 or higher.' ); 55 if ( ! class_exists( 'Twitter_CompatibilityNotice' ) ) { 56 require_once( dirname(__FILE__) . '/compatibility-notice.php' ); 57 } 58 59 // possibly display a notice, trigger error 60 add_action( 'admin_init', array( 'Twitter_CompatibilityNotice', 'adminInit' ) ); 61 62 // stop execution of this file 58 63 return; 59 64 } … … 65 70 add_action( 66 71 'plugins_loaded', 67 array( '\ \Twitter\\WordPress\\PluginLoader', 'init' ),72 array( '\Twitter\WordPress\PluginLoader', 'init' ), 68 73 0, // priority 69 74 0 // expected arguments
Note: See TracChangeset
for help on using the changeset viewer.