Changeset 1502033
- Timestamp:
- 09/24/2016 09:16:14 PM (10 years ago)
- Location:
- postats/trunk
- Files:
-
- 4 added
- 2 edited
-
css (added)
-
css/main.css (added)
-
postats.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
views (added)
-
views/stats.php (added)
Legend:
- Unmodified
- Added
- Removed
-
postats/trunk/postats.php
r1335026 r1502033 41 41 add_action( 'plugins_loaded', array( $self, 'action_plugins_loaded' ) ); 42 42 add_filter( 'the_content', array( $self, 'filter_the_content' ) ); 43 add_action( 'wp_enqueue_scripts', array( $self, 'enqueue_scripts' ) ); 44 } 45 46 public function enqueue_scripts() { 47 wp_enqueue_style( 'postats', plugin_dir_url( __FILE__ ) . 'css/main.css' ); 43 48 } 44 49 … … 68 73 $post_id = get_the_ID(); 69 74 70 $output = sprintf( '<h6 class="postats postats-%s">' . __( 'Post Stats', 'postats' ) . '</h6>', $post_id ); 71 $output .= '<ul>'; 72 $output .= '<li>' . sprintf( _n( '%d word', '%d words', $words, 'postats' ), $words ) . '</li>'; 73 $output .= '<li>' . sprintf( _n( '%d character', '%d characters', $characters, 'postats' ), $characters ) . '</li>'; 74 $output .= '<li>' . sprintf( __( '%d s reading time', 'postats' ), $reading_time ) . '</li>'; 75 $output .= '<li>' . sprintf( __( '%d s speaking time', 'postats' ), $speaking_time ) . '</li>'; 76 $output .= '</ul>'; 75 ob_start(); 76 include plugin_dir_path( __FILE__ ) . 'views/stats.php'; 77 $output = ob_get_clean(); 77 78 78 79 } -
postats/trunk/readme.txt
r1335026 r1502033 3 3 Tags: post, statistics, reading, post 4 4 Requires at least: 4.0 5 Tested up to: 4. 46 Stable tag: 1.0 5 Tested up to: 4.6 6 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 == Changelog == 30 30 31 = 1.0.1 = 32 * Add CSS. 33 * Move template in separate file. 34 31 35 = 1.0 = 32 36 * Initial version.
Note: See TracChangeset
for help on using the changeset viewer.