Changeset 3087121
- Timestamp:
- 05/15/2024 12:15:49 PM (11 months ago)
- Location:
- custom-post-type-pdf-attachment
- Files:
-
- 48 added
- 3 edited
-
tags/3.4.6 (added)
-
tags/3.4.6/config (added)
-
tags/3.4.6/config/config-attachment-file-types.php (added)
-
tags/3.4.6/config/config-attachment-icons.php (added)
-
tags/3.4.6/css (added)
-
tags/3.4.6/css/style_admin.css (added)
-
tags/3.4.6/css/style_front.css (added)
-
tags/3.4.6/custom-pdf-attachment.php (added)
-
tags/3.4.6/functions.php (added)
-
tags/3.4.6/images (added)
-
tags/3.4.6/images/doc.png (added)
-
tags/3.4.6/images/image.png (added)
-
tags/3.4.6/images/paypal.png (added)
-
tags/3.4.6/images/pdf.png (added)
-
tags/3.4.6/images/ppt.png (added)
-
tags/3.4.6/images/rss.png (added)
-
tags/3.4.6/images/xls.png (added)
-
tags/3.4.6/images/zip.png (added)
-
tags/3.4.6/includes (added)
-
tags/3.4.6/includes/class-attachment-list.php (added)
-
tags/3.4.6/includes/class-attachment.php (added)
-
tags/3.4.6/includes/class-filesize.php (added)
-
tags/3.4.6/includes/class-form.php (added)
-
tags/3.4.6/includes/class-latest-attachment.php (added)
-
tags/3.4.6/includes/class-scripts.php (added)
-
tags/3.4.6/includes/class-settings.php (added)
-
tags/3.4.6/index.php (added)
-
tags/3.4.6/js (added)
-
tags/3.4.6/js/ap-tabs.js (added)
-
tags/3.4.6/js/ap.cookie.js (added)
-
tags/3.4.6/js/cpt.js (added)
-
tags/3.4.6/languages (added)
-
tags/3.4.6/languages/custom-post-type-pdf-attachment-da_DK.mo (added)
-
tags/3.4.6/languages/custom-post-type-pdf-attachment-da_DK.po (added)
-
tags/3.4.6/languages/custom-post-type-pdf-attachment.pot (added)
-
tags/3.4.6/pdf-attachment-widget.php (added)
-
tags/3.4.6/readme.txt (added)
-
tags/3.4.6/shortcode-functions.php (added)
-
tags/3.4.6/view (added)
-
tags/3.4.6/view/admin (added)
-
tags/3.4.6/view/admin/attachment-form.php (added)
-
tags/3.4.6/view/admin/attachment-not-defined.php (added)
-
tags/3.4.6/view/admin/donate.php (added)
-
tags/3.4.6/view/admin/help-info.php (added)
-
tags/3.4.6/view/admin/help.php (added)
-
tags/3.4.6/view/admin/info.php (added)
-
tags/3.4.6/view/admin/pro-add.php (added)
-
tags/3.4.6/view/admin/settings.php (added)
-
trunk/custom-pdf-attachment.php (modified) (1 diff)
-
trunk/functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-type-pdf-attachment/trunk/custom-pdf-attachment.php
r2513401 r3087121 4 4 Plugin URI: https://wordpress.org/plugins/custom-post-type-pdf-attachment/ 5 5 Description: This plugin will allow you to upload files to your post or pages or any other custom post types. You can either use shortcodes or functions to display attachments. 6 Version: 3.4. 56 Version: 3.4.6 7 7 Text Domain: custom-post-type-pdf-attachment 8 8 Author: aviplugins.com 9 9 Author URI: https://www.aviplugins.com/ 10 */10 */ 11 11 12 12 /** 13 ||||| 14 <(`0_0`)> 15 ()(afo)()16 ()-()17 **/13 * ||||| 14 * <(`0_0`)> 15 * ()(afo)() 16 * ()-() 17 **/ 18 18 19 define( 'CPTA_PLUGIN_DIR', 'custom-post-type-pdf-attachment');20 define( 'CPTA_PLUGIN_PATH', dirname( __FILE__ ));19 define('CPTA_PLUGIN_DIR', 'custom-post-type-pdf-attachment'); 20 define('CPTA_PLUGIN_PATH', dirname(__FILE__)); 21 21 22 function plug_install_custom_post_type_attachment(){ 23 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 24 if ( is_plugin_active( 'custom-post-type-attachment-pro/custom-pdf-attachment.php' ) ) { 25 wp_die('It seems you have <strong>Custom Post Type Attachment PRO</strong> plugin activated. Please deactivate to continue.'); 26 exit; 27 } 28 29 include_once CPTA_PLUGIN_PATH . '/config/config-attachment-file-types.php'; 30 include_once CPTA_PLUGIN_PATH . '/config/config-attachment-icons.php'; 22 function plug_install_custom_post_type_attachment() 23 { 24 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 25 if (is_plugin_active('custom-post-type-attachment-pro/custom-pdf-attachment.php')) { 26 wp_die('It seems you have <strong>Custom Post Type Attachment PRO</strong> plugin activated. Please deactivate to continue.'); 27 exit; 28 } 31 29 32 include_once CPTA_PLUGIN_PATH . '/includes/class-form.php'; 33 include_once CPTA_PLUGIN_PATH . '/includes/class-settings.php'; 34 include_once CPTA_PLUGIN_PATH . '/includes/class-scripts.php'; 35 include_once CPTA_PLUGIN_PATH . '/includes/class-attachment.php'; 36 include_once CPTA_PLUGIN_PATH . '/includes/class-attachment-list.php'; 37 include_once CPTA_PLUGIN_PATH . '/includes/class-latest-attachment.php'; 38 include_once CPTA_PLUGIN_PATH . '/includes/class-filesize.php'; 39 include_once CPTA_PLUGIN_PATH . '/pdf-attachment-widget.php'; 40 include_once CPTA_PLUGIN_PATH . '/shortcode-functions.php'; 41 include_once CPTA_PLUGIN_PATH . '/functions.php'; 42 43 new CPTA_Settings; 44 new CPTA_Scripts; 45 new CPTA_Attachments_Init; 46 new CPTA_Attachments_List_Init; 30 include_once CPTA_PLUGIN_PATH . '/config/config-attachment-file-types.php'; 31 include_once CPTA_PLUGIN_PATH . '/config/config-attachment-icons.php'; 32 33 include_once CPTA_PLUGIN_PATH . '/includes/class-form.php'; 34 include_once CPTA_PLUGIN_PATH . '/includes/class-settings.php'; 35 include_once CPTA_PLUGIN_PATH . '/includes/class-scripts.php'; 36 include_once CPTA_PLUGIN_PATH . '/includes/class-attachment.php'; 37 include_once CPTA_PLUGIN_PATH . '/includes/class-attachment-list.php'; 38 include_once CPTA_PLUGIN_PATH . '/includes/class-latest-attachment.php'; 39 include_once CPTA_PLUGIN_PATH . '/includes/class-filesize.php'; 40 include_once CPTA_PLUGIN_PATH . '/pdf-attachment-widget.php'; 41 include_once CPTA_PLUGIN_PATH . '/shortcode-functions.php'; 42 include_once CPTA_PLUGIN_PATH . '/functions.php'; 43 44 new CPTA_Settings; 45 new CPTA_Scripts; 46 new CPTA_Attachments_Init; 47 new CPTA_Attachments_List_Init; 47 48 } 48 49 49 class WP_Custom_Post_Type_Attachment_Pre_Checking { 50 function __construct() { 51 plug_install_custom_post_type_attachment(); 52 } 50 class WP_Custom_Post_Type_Attachment_Pre_Checking 51 { 52 public function __construct() 53 { 54 plug_install_custom_post_type_attachment(); 55 } 53 56 } 54 57 55 58 new WP_Custom_Post_Type_Attachment_Pre_Checking; 56 59 57 add_action( 'widgets_init', function(){ register_widget( 'PDF_Attachment_Widget' ); });60 add_action('widgets_init', function () {register_widget('PDF_Attachment_Widget');}); 58 61 59 add_shortcode( 'pdf_attachment', 'custom_pdf_attachment_shortcode');60 add_shortcode( 'pdf_all_attachments', 'custom_pdf_all_attachments_shortcode');62 add_shortcode('pdf_attachment', 'custom_pdf_attachment_shortcode'); 63 add_shortcode('pdf_all_attachments', 'custom_pdf_all_attachments_shortcode'); 61 64 62 add_action( 'plugins_loaded', 'cpta_load_plugin_textdomain');65 add_action('plugins_loaded', 'cpta_load_plugin_textdomain'); 63 66 64 register_activation_hook( __FILE__, 'cpta_setup_init');67 register_activation_hook(__FILE__, 'cpta_setup_init'); 65 68 66 function cpta_setup_init() { 67 global $wpdb; 69 function cpta_setup_init() 70 { 71 global $wpdb; 68 72 69 // older versions compatibility //70 $upload_dir = wp_upload_dir();71 $query = "UPDATE `".$wpdb->base_prefix."postmeta` set meta_value = replace(meta_value,'".$upload_dir['baseurl']."','') WHERE `meta_key` LIKE '%cpt_pdf_attachment%'";72 $wpdb->query($query);73 // older versions compatibility //73 // older versions compatibility // 74 $upload_dir = wp_upload_dir(); 75 $query = "UPDATE `" . $wpdb->base_prefix . "postmeta` set meta_value = replace(meta_value,'" . $upload_dir['baseurl'] . "','') WHERE `meta_key` LIKE '%cpt_pdf_attachment%'"; 76 $wpdb->query($query); 77 // older versions compatibility // 74 78 } -
custom-post-type-pdf-attachment/trunk/functions.php
r2415897 r3087121 1 1 <?php 2 2 3 if(!function_exists('cpta_load_plugin_textdomain')){ 4 function cpta_load_plugin_textdomain() { 5 load_plugin_textdomain( 'custom-post-type-pdf-attachment', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' ); 6 } 3 if (!function_exists('cpta_load_plugin_textdomain')) { 4 function cpta_load_plugin_textdomain() 5 { 6 load_plugin_textdomain('custom-post-type-pdf-attachment', false, basename(dirname(__FILE__)) . '/languages/'); 7 } 7 8 } 8 9 9 if(!function_exists('cpta_get_file_url')){ 10 function cpta_get_file_url($post_id = '', $file = 1){ 11 $file_path = get_post_meta($post_id, 'cpt_pdf_attachment'.$file, true); 12 if($file_path){ 13 $upload_dir = wp_upload_dir(); 14 return $upload_dir['baseurl'].$file_path; 15 } 16 return false; 17 } 10 if (!function_exists('cpta_get_file_url')) { 11 function cpta_get_file_url($post_id = '', $file = 1) 12 { 13 $file_path = esc_html(get_post_meta($post_id, 'cpt_pdf_attachment' . $file, true)); 14 if ($file_path) { 15 $upload_dir = wp_upload_dir(); 16 return $upload_dir['baseurl'] . $file_path; 17 } 18 return false; 19 } 18 20 } 19 21 20 if(!function_exists('cpta_use_media_library')){ 21 function cpta_use_media_library(){ 22 $use_default_media_library = get_option('use_default_media_library'); 23 return ($use_default_media_library == 'Yes'?true:false); 24 } 22 if (!function_exists('cpta_use_media_library')) { 23 function cpta_use_media_library() 24 { 25 $use_default_media_library = get_option('use_default_media_library'); 26 return ($use_default_media_library == 'Yes' ? true : false); 27 } 25 28 } -
custom-post-type-pdf-attachment/trunk/readme.txt
r2846939 r3087121 4 4 Tags: file upload, upload, custom attachment, attachment, post attachment, file attachment, upload file, pdf in post, pdf in custom post type, filepost pdf, file attachment, file, pdf, images, docs, document attachment 5 5 Requires at least: 2.0.2 6 Tested up to: 6. 1.17 Stable tag: 3.4. 56 Tested up to: 6.5.3 7 Stable tag: 3.4.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 64 64 65 65 == Changelog == 66 67 = 3.4.6 = 68 * Bug fixes. 66 69 67 70 = 3.4.5 =
Note: See TracChangeset
for help on using the changeset viewer.