Changeset 943206
- Timestamp:
- 07/04/2014 05:40:35 AM (12 years ago)
- File:
-
- 1 edited
-
scribd-doc-embedder/trunk/scribd_doc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scribd-doc-embedder/trunk/scribd_doc.php
r863633 r943206 5 5 Plugin URI: http://ericbol.es/ 6 6 Description: Uses the Scribd API to embed supported Scribd documents (e.g. PDF, MS Office, ePub, and many others) into a web page using 7 the Scribd Docs Reader. 7 the Scribd Docs Reader. 8 8 Author: Eric Boles 9 9 Author URI: http://www.ericbol.es/ 10 Version: 1.010 Version: 2.0 11 11 License: GPLv2 12 12 */ … … 137 137 add_shortcode("scribd-url", "scribd_url"); 138 138 add_shortcode("scribd-doc", "scribd_doc"); 139 140 // Hooks your functions into the correct filters 141 function scribd_doc_add_mce_button() { 142 // check user permissions 143 if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) { 144 return; 145 } 146 // check if WYSIWYG is enabled 147 if ( 'true' == get_user_option( 'rich_editing' ) ) { 148 add_filter( 'mce_external_plugins', 'scribd_doc_tinymce' ); 149 add_filter( 'mce_buttons', 'scribd_doc_mce_button' ); 150 } 151 } 152 add_action('admin_head', 'scribd_doc_add_mce_button'); 153 154 // Declare script for new button 155 function scribd_doc_tinymce( $plugin_array ) { 156 $wp_version = get_bloginfo( 'version' ); 157 if ( version_compare( $wp_version, '3.9', '>=' ) ) { 158 $plugin_array['scribd_doc_mce_button'] = plugins_url( '/js/scribd-doc-mce-button.js' , __FILE__ ); 159 return $plugin_array; 160 } 161 } 162 163 // Register new button in the editor 164 function scribd_doc_mce_button( $buttons ) { 165 array_push( $buttons, 'scribd_doc_mce_button' ); 166 return $buttons; 167 } 168 169 function scribd_doc_mce_css() { 170 wp_enqueue_style('scribd-doc-sc', plugins_url('/css/scribd-doc-mce-style.css', __FILE__) ); 171 } 172 add_action( 'admin_enqueue_scripts', 'scribd_doc_mce_css' ); 173 139 174 ?>
Note: See TracChangeset
for help on using the changeset viewer.