array( 'name' => __( 'Document Embedder'), 'singular_name' => __( 'Document Embedder' ), 'add_new' => __( 'Add New Doc' ), 'add_new_item' => __( 'Add New Doc' ), 'edit_item' => __( 'Edit' ), 'new_item' => __( 'New item' ), 'view_item' => __( 'View item' ), 'search_items' => __( 'Search'), 'not_found' => __( 'Sorry, we couldn\'t find the power point file you are looking for.' ) ), 'public' => false, 'show_ui' => true, 'publicly_queryable' => true, 'exclude_from_search' => true, 'menu_position' => 14, 'menu_icon' =>PPV_PLUGIN_DIR .'/img/doc.png', 'has_archive' => false, 'hierarchical' => false, 'capability_type' => 'post', 'rewrite' => array( 'slug' => 'ppt_viewer' ), 'supports' => array( 'title' ) ) ); } /*-------------------------------------------------------------------------------*/ /* Metabox /*-------------------------------------------------------------------------------*/ include_once('metabox/meta-box-class/my-meta-box-class.php'); include_once('metabox/class-usage-demo.php'); //include_once('tinymce/ewic-tinymce.php'); /*-------------------------------------------------------------------------------*/ /* Hide & Disabled View, Quick Edit and Preview Button /*-------------------------------------------------------------------------------*/ function ppv_remove_row_actions( $idtions ) { global $post; if( $post->post_type == 'ppt_viewer' ) { unset( $idtions['view'] ); unset( $idtions['inline hide-if-no-js'] ); } return $idtions; } if ( is_admin() ) { add_filter( 'post_row_actions','ppv_remove_row_actions', 10, 2 );} /*-------------------------------------------------------------------------------*/ /* HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button /*-------------------------------------------------------------------------------*/ function ppv_hide_publishing_actions(){ $my_post_type = 'ppt_viewer'; global $post; if($post->post_type == $my_post_type){ echo ' '; } } add_action('admin_head-post.php', 'ppv_hide_publishing_actions'); add_action('admin_head-post-new.php', 'ppv_hide_publishing_actions'); /*-------------------------------------------------------------------------------*/ /* Change publish button to save. /*-------------------------------------------------------------------------------*/ add_filter( 'gettext', 'ppv_change_publish_button', 10, 2 ); function ppv_change_publish_button( $translation, $text ) { if ( 'ppt_viewer' == get_post_type()) if ( $text == 'Publish' ) return 'Save'; return $translation; } // ONLY MOVIE CUSTOM TYPE POSTS add_filter('manage_ppt_viewer_posts_columns', 'ST4_columns_head_only_ppt_viewer', 10); add_action('manage_ppt_viewer_posts_custom_column', 'ST4_columns_content_only_ppt_viewer', 10, 2); // CREATE TWO FUNCTIONS TO HANDLE THE COLUMN function ST4_columns_head_only_ppt_viewer($defaults) { $defaults['directors_name'] = 'ShortCode'; return $defaults; } function ST4_columns_content_only_ppt_viewer($column_name, $post_ID) { if ($column_name == 'directors_name') { // show content of 'directors_name' column echo ''; } } /*-------------------------------------------------------------------------------*/ // sub menu page /*-------------------------------------------------------------------------------*/ add_action('admin_menu', 'ppv_custom_submenu_page'); function ppv_custom_submenu_page() { add_submenu_page( 'edit.php?post_type=ppt_viewer', 'Developer', 'Developer', 'manage_options', 'ppv_submenu_page', 'ppv_submenu_page_callback' ); } function ppv_submenu_page_callback() { echo '
It is hard to continue development and support for this plugin without contributions from users like you. If you enjoy using the plugin and find it useful, please consider support by DONATION or BUY THE PRO VERSION (Ad Less) of the Plugin. Your support will help encourage and support the plugin’s continued development and better user support.

LightBox Addons enable you to open any doc in a Nice LightBox
| See Demo | Buy Now |
Need some improvement ? Please let me know how can i improve the Plugin.
';}; // Add Sortcode function ppv_cpt_content_func($atts){ extract( shortcode_atts( array( 'id' => null, ), $atts ) ); $file_url=get_post_meta($id,'_groupped_ppv_file_url', true); $ext_url=get_post_meta($id,'_groupped_ppv_ext_url', true); if (is_array($file_url)){$url=$file_url['url'];}else{$url=$ext_url;} $width=get_post_meta($id,'ppt_ppv_width', true); $height= get_post_meta($id,'ppt_ppv_height', true); if ($width==''){$width='100%';} else{$width=$width.'px';} if ($height==''){$height='600px'; } else {$height=$height.'px';} $frame_style= 'width:'.$width.'; '. 'height:'. $height. ';'; $viewer_type=get_post_meta($id,'ppt_ppv_type', true); if($viewer_type == 'googledocs'){ $base_url = 'https://docs.google.com/gview?embedded=true&url='; }else{ $base_url = 'https://view.officeapps.live.com/op/embed.aspx?src='; } if($url==''){ echo '