Changeset 3348753
- Timestamp:
- 08/22/2025 05:40:24 PM (7 months ago)
- Location:
- wp-todo
- Files:
-
- 11 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
trunk/inc/enqueue.php (modified) (1 diff)
-
trunk/list_table/custom_columns.php (modified) (4 diffs)
-
trunk/meta_boxes/wptodo_meta_boxe.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/todo/count_down_timer.php (modified) (2 diffs)
-
trunk/todo/modal_view.php (modified) (10 diffs)
-
trunk/todo/wptodo_custom_post_type.php (modified) (2 diffs)
-
trunk/wp-todo.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-todo/trunk/inc/enqueue.php
r3345168 r3348753 18 18 // Custom CSS for modal 19 19 wp_add_inline_style( 'jquery-ui-css', '.wptodo-modal { display:none; }' ); 20 21 // Custom CSS Style 22 wp_enqueue_style( "style", PLUGIN_DIR_URL ."assets/css/style.css", array(), "1.0", true ); 20 23 }); 24 25 add_action('admin_enqueue_scripts', function($hook) { 26 if ($hook !== 'toplevel_page_wp-todo-dashboard') return; 27 28 // FullCalendar 29 wp_enqueue_script('fullcalendar-js', PLUGIN_DIR_URL . 'assets/js/FullCalendar.min.js', [], '6.1.8', true); 30 31 // SortableJS for Kanban 32 wp_enqueue_script('sortable-js', PLUGIN_DIR_URL . 'assets/js/Sortable.min.js', [], '1.15.0', true); 33 34 // Custom dashboard script 35 wp_enqueue_script('wptodo-dashboard-js', PLUGIN_DIR_URL . 'assets/js/wptodo-dashboard.js', ['jquery','fullcalendar-js','sortable-js'], '1.0', true); 36 37 wp_localize_script('wptodo-dashboard-js', 'wptodo_dashboard', [ 38 'ajax_url' => admin_url('admin-ajax.php'), 39 'nonce' => wp_create_nonce('wp-todo_dashboard'), 40 ]); 41 }); -
wp-todo/trunk/list_table/custom_columns.php
r3345168 r3348753 36 36 37 37 case 'todo_priority': 38 $priority = get_post_meta( $post_id , '_todo_priority', true ); 38 $priority_terms = wp_get_post_terms($post_id, 'todo_priority', ['fields' => 'names']); 39 $priority = !empty($priority_terms) ? $priority_terms[0] : ''; 39 40 $priority_class = ''; 40 41 switch ( strtolower( $priority ) ) { … … 42 43 case 'normal': $priority_class = 'priority-normal'; break; 43 44 case 'low': $priority_class = 'priority-low'; break; 44 case ' important': $priority_class = 'priority-important'; break;45 case 'critical': $priority_class = 'priority-critical'; break; 45 46 } 46 47 echo '<span class="' . esc_attr($priority_class) . '">' . esc_html( $priority ) . '</span>'; … … 48 49 49 50 case 'todo_status': 50 $status = get_post_meta( $post_id , '_todo_status', true ); 51 $status_terms = wp_get_post_terms($post_id, 'todo_status', ['fields' => 'names']); 52 $status = !empty($status_terms) ? $status_terms[0] : ''; 51 53 $status_class = ''; 52 54 switch ( strtolower( $status ) ) { 53 55 case 'not started': $status_class = 'status-not-started'; break; 54 56 case 'in progress': $status_class = 'status-in-progress'; break; 55 case 'pending': $status_class = 'status-pending'; break;56 57 case 'in review': $status_class = 'status-in-review'; break; 57 58 case 'completed': $status_class = 'status-completed'; break; 58 case 'cancelled': $status_class = 'status-cancelled'; break;59 59 } 60 60 echo '<span class="' . esc_attr($status_class) . '">' . esc_html( $status ) . '</span>'; … … 98 98 .priority-normal { color:#fff; background:#5bc0de; padding:3px 6px; border-radius:4px; font-weight:bold; } 99 99 .priority-low { color:#fff; background:#5bc0de; padding:3px 6px; border-radius:4px; font-weight:bold; } 100 .priority- important{ color:#fff; background:#f0ad4e; padding:3px 6px; border-radius:4px; font-weight:bold; }100 .priority-critical { color:#fff; background:#f0ad4e; padding:3px 6px; border-radius:4px; font-weight:bold; } 101 101 102 102 /* Status */ 103 103 .status-not-started { background:#6c757d; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; } 104 104 .status-in-progress { background:#0275d8; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; } 105 .status-pending { background:#fd7e14; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; }106 105 .status-in-review { background:#17a2b8; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; } 107 106 .status-completed { background:#5cb85c; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; } 108 .status-cancelled { background:#dc3545; color:#fff; padding:3px 6px; border-radius:4px; font-weight:bold; }109 107 </style>'; 110 108 }); 109 110 111 // remove comment column from the table 112 add_filter( 'manage_wp-todo_posts_columns', function( $columns ) { 113 // Remove the comments column 114 if ( isset( $columns['comments'] ) ) { 115 unset( $columns['comments'] ); 116 } 117 return $columns; 118 }); -
wp-todo/trunk/meta_boxes/wptodo_meta_boxe.php
r3345168 r3348753 1 1 <?php 2 2 /** 3 * About meta box Information 4 * 3 * Register custom taxonomies for Status & Priority 4 */ 5 function wptodo_register_taxonomies() { 6 // Status 7 register_taxonomy('todo_status', 'wp-todo', [ 8 'labels' => [ 9 'name' => 'Statuses', 10 'singular_name' => 'Status', 11 ], 12 'public' => false, 13 'show_ui' => false, // hide default taxonomy meta box 14 'hierarchical' => false, 15 ]); 16 17 // Priority 18 register_taxonomy('todo_priority', 'wp-todo', [ 19 'labels' => [ 20 'name' => 'Priorities', 21 'singular_name' => 'Priority', 22 ], 23 'public' => false, 24 'show_ui' => false, // hide default taxonomy meta box 25 'hierarchical' => false, 26 ]); 27 } 28 add_action('init', 'wptodo_register_taxonomies'); 29 30 31 /** 32 * Add custom meta boxes 5 33 */ 6 34 function wptodo_add_meta_box() { … … 12 40 add_action('add_meta_boxes', 'wptodo_add_meta_box'); 13 41 42 43 /** 44 * Meta box content 45 */ 14 46 function wptodo_meta_box_callback($post, $meta) { 15 47 wp_nonce_field('wp-todo_add_meta_box_nonce', 'wp-todo_add_meta_box_nonce_field'); … … 18 50 case 'todo_deadline': 19 51 $value = get_post_meta($post->ID, '_todo_deadline', true) ?: gmdate('Y-m-d'); 20 echo '<input type="date" name="todo_deadline" value="' .esc_attr($value).'" style="width:100%;">';52 echo '<input type="date" name="todo_deadline" value="' . esc_attr($value) . '" style="width:100%;">'; 21 53 break; 22 54 … … 26 58 echo '<select name="todo_assignee" style="width:100%">'; 27 59 foreach ($users as $user) { 28 echo '<option value="' . esc_attr( $user->ID ) . '" ' . selected( $selected, $user->ID, false ) . '>' . esc_html( $user->display_name) . '</option>';60 echo '<option value="' . esc_attr($user->ID) . '" ' . selected($selected, $user->ID, false) . '>' . esc_html($user->display_name) . '</option>'; 29 61 } 30 62 echo '</select>'; … … 32 64 33 65 case 'todo_status': 34 $status = get_post_meta($post->ID, '_todo_status', true) ?: 'Not Started'; 35 $options = ['Not Started','In Progress','Pending','In Review','Completed','Cancelled']; 66 $terms = get_terms(['taxonomy' => 'todo_status', 'hide_empty' => false]); 67 $current = wp_get_post_terms($post->ID, 'todo_status', ['fields' => 'ids']); 68 $current = $current ? $current[0] : ''; 36 69 echo '<select name="todo_status" style="width:100%">'; 37 foreach ($ options as $opt) {38 echo '<option value="' . esc_attr( $opt ) . '" ' . selected( $status, $opt, false ) . '>' . esc_html( $opt) . '</option>';70 foreach ($terms as $term) { 71 echo '<option value="' . esc_attr($term->term_id) . '" ' . selected($current, $term->term_id, false) . '>' . esc_html($term->name) . '</option>'; 39 72 } 40 73 echo '</select>'; … … 42 75 43 76 case 'todo_priority': 44 $priority = get_post_meta($post->ID, '_todo_priority', true) ?: 'Normal'; 45 $options = ['Low','Normal','High','Important']; 77 $terms = get_terms(['taxonomy' => 'todo_priority', 'hide_empty' => false]); 78 $current = wp_get_post_terms($post->ID, 'todo_priority', ['fields' => 'ids']); 79 $current = $current ? $current[0] : ''; 46 80 echo '<select name="todo_priority" style="width:100%">'; 47 foreach ($ options as $opt) {48 echo '<option value="' . esc_attr( $opt ) . '" ' . selected( $priority, $opt, false ) . '>' . esc_html( $opt) . '</option>';81 foreach ($terms as $term) { 82 echo '<option value="' . esc_attr($term->term_id) . '" ' . selected($current, $term->term_id, false) . '>' . esc_html($term->name) . '</option>'; 49 83 } 50 84 echo '</select>'; … … 54 88 55 89 90 /** 91 * Save meta box fields 92 */ 56 93 function wptodo_save_meta_box($post_id) { 57 // Verify nonce58 94 if (!isset($_POST['wp-todo_add_meta_box_nonce_field']) || 59 !wp_verify_nonce(sanitize_text_field(wp_unslash( $_POST['wp-todo_add_meta_box_nonce_field'])), 'wp-todo_add_meta_box_nonce')) {95 !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wp-todo_add_meta_box_nonce_field'])), 'wp-todo_add_meta_box_nonce')) { 60 96 return; 61 97 } 62 98 63 // Check autosave64 99 if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; 65 66 // Check permissions67 100 if (!current_user_can('edit_post', $post_id)) return; 68 101 69 // Save field102 // Save deadline 70 103 if (isset($_POST['todo_deadline'])) { 71 104 update_post_meta($post_id, '_todo_deadline', sanitize_text_field(wp_unslash($_POST['todo_deadline']))); 72 105 } 106 107 // Save assignee 73 108 if (isset($_POST['todo_assignee'])) { 74 update_post_meta($post_id, '_todo_assignee', sanitize_text_field(wp_unslash($_POST['todo_assignee'])));109 update_post_meta($post_id, '_todo_assignee', intval($_POST['todo_assignee'])); 75 110 } 111 112 // Save taxonomy terms 76 113 if (isset($_POST['todo_status'])) { 77 update_post_meta($post_id, '_todo_status', sanitize_text_field(wp_unslash($_POST['todo_status'])));114 wp_set_post_terms($post_id, [(int) $_POST['todo_status']], 'todo_status', false); 78 115 } 79 116 if (isset($_POST['todo_priority'])) { 80 update_post_meta($post_id, '_todo_priority', sanitize_text_field(wp_unslash($_POST['todo_priority'])));117 wp_set_post_terms($post_id, [(int) $_POST['todo_priority']], 'todo_priority', false); 81 118 } 82 119 } 83 120 add_action('save_post', 'wptodo_save_meta_box'); 121 122 123 /** 124 * Pre-populate default taxonomy terms on plugin/theme activation 125 */ 126 function wptodo_register_default_terms() { 127 // Statuses 128 $statuses = ['Not Started','In Progress','In Review','Completed']; 129 foreach ($statuses as $status) { 130 if (!term_exists($status, 'todo_status')) { 131 wp_insert_term($status, 'todo_status'); 132 } 133 } 134 135 // Priorities 136 $priorities = ['Low','Normal','High','Critical']; 137 foreach ($priorities as $priority) { 138 if (!term_exists($priority, 'todo_priority')) { 139 wp_insert_term($priority, 'todo_priority'); 140 } 141 } 142 } 143 add_action('init', 'wptodo_register_default_terms'); 144 -
wp-todo/trunk/readme.txt
r3345168 r3348753 4 4 Requires at least: 6.4 or higher 5 5 Tested up to: 6.8 6 Stable tag: 2. 0.26 Stable tag: 2.1.0 7 7 Requires PHP: 7.2.24 8 8 License: GPLv2 … … 16 16 17 17 == Features == 18 * **Brand new design & re-developed from scratch - More Features comming soon!** 18 * Kanban board 19 * FullCalendar 19 20 * Create and manage tasks and to-do lists 20 * Assign priorities ( High, Medium, Low) to tasks21 * Set statuses (Not Started, In Progress, On Hold, Review, Completed, Cancelled)21 * Assign priorities (Critical, High, Normal, Low) to tasks 22 * Set statuses (Not Started, In Progress, In Review, Completed) 22 23 * Add deadlines for timely task completion 23 24 * Track milestones and progress … … 34 35 35 36 == Detailed Walkthrough == 36 [youtube https://youtu.be/ KQF2ouZ1mJM]37 [youtube https://youtu.be/d6pcudlgMP4] 37 38 38 39 == Contribute == 39 40 This may have bugs and lack of many features. If you want to contribute on this project, you are more than welcome. Please fork the repository from [Github](https://github.com/delower186/wp-todo). 40 41 41 == Donate == 42 Please [donate]() for this awesome plugin to continue it's development to bring more awesome features. 42 == Custom Development & Feature Requests == 43 43 44 Need a custom feature or want to enhance Project Manager to fit your workflow? 45 I provide custom WordPress plugin development, feature requests, and tailored solutions to make your project management seamless. 46 47 = Contact for Custom Development = 48 🌐 Website: [https://sandalia.com.bd/apps](https://sandalia.com.bd/apps) 49 💼 Upwork: [Upwork](https://www.upwork.com/freelancers/delower) 50 💼 Linkedin: [Linkedin](https://www.linkedin.com/in/delower186/) 51 52 = Do You need any Data Scraping Services? Try = 53 🌐 Marketplace: [SandaliaApps](https://apify.com/sandaliaapps) 54 55 == Try My Other Plugins == 56 57 If you like **WP To Do**, you might also enjoy my other plugins: 58 59 = [Project Manager Pro](https://wordpress.org/plugins/project-manager-pro) = 60 Project Manager Pro is perfect for freelancers, small teams, or anyone who wants to manage projects directly from their WordPress admin panel without needing external tools. 44 61 45 62 == Frequently Asked Questions == … … 59 76 60 77 == Changelog == 78 79 = 2.1.0 = 80 * Kanban board added 81 * FullCalendar added 82 * Comments added to todo details page 83 84 85 = 2.0.2 = 86 * Best Practice applied 61 87 62 88 = 2.0.1 = -
wp-todo/trunk/todo/count_down_timer.php
r3345168 r3348753 8 8 if ( $column === 'todo_deadline_countdown' ) { 9 9 $deadline = get_post_meta( $post_id, '_todo_deadline', true ); 10 $status = get_post_meta( $post_id, '_todo_status', true ); 10 $status_terms = wp_get_post_terms($post_id, 'todo_status', ['fields' => 'names']); 11 $status = !empty($status_terms) ? $status_terms[0] : ''; 11 12 if ( $deadline ) { 12 13 echo '<span class="wptodo-countdown" data-deadline="'.esc_attr($deadline).'" data-status="'.esc_attr(strtolower($status)).'"></span>'; … … 76 77 } 77 78 78 if(status === 'cancelled') {79 $(element).html('😢').addClass('wptodo-cancelled');80 return;81 }82 83 79 if(diff <= 0){ 84 80 $(element).text('Deadline passed').addClass('wptodo-passed'); -
wp-todo/trunk/todo/modal_view.php
r3345168 r3348753 1 1 <?php 2 /** 3 * AJAX: Quick View Modal 4 */ 2 5 add_action( 'wp_ajax_wp-todo_quick_view', function() { 3 // First, safely get and unslash the nonce4 6 $nonce = isset( $_POST['wp-todo_nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['wp-todo_nonce'] ) ) : ''; 5 6 // Verify the nonce7 7 if ( ! wp_verify_nonce( $nonce, 'wp-todo_action' ) ) { 8 8 wp_send_json_error( array( 'message' => 'Security check failed' ), 400 ); 9 exit; 10 } 11 12 // Now process the post ID 9 } 10 13 11 $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0; 14 15 12 if ( ! $post_id ) wp_send_json_error('Invalid post ID'); 16 13 … … 18 15 if ( ! $post || $post->post_type !== 'wp-todo' ) wp_send_json_error('Post not found'); 19 16 20 $assignee_id = get_post_meta( $post_id, '_todo_assignee', true );17 $assignee_id = get_post_meta( $post_id, '_todo_assignee', true ); 21 18 $assignee_name = $assignee_id ? get_the_author_meta('display_name', $assignee_id) : '—'; 22 $priority = get_post_meta( $post_id, '_todo_priority', true ) ?: 'Normal'; 23 $status = get_post_meta( $post_id, '_todo_status', true ) ?: 'Not Started'; 24 $deadline = get_post_meta( $post_id, '_todo_deadline', true ) ?: '—'; 19 $priority_terms = wp_get_post_terms($post_id, 'todo_priority', ['fields' => 'names']); 20 $priority = !empty($priority_terms) ? $priority_terms[0] : '-'; 21 $status_terms = wp_get_post_terms($post_id, 'todo_status', ['fields' => 'names']); 22 $status = !empty($status_terms) ? $status_terms[0] : '-'; 23 $deadline = get_post_meta( $post_id, '_todo_deadline', true ) ?: '—'; 25 24 26 25 $content = apply_filters('the_content', $post->post_content); 27 26 28 if ( !$deadline) {27 if ( ! $deadline ) { 29 28 $deadline = gmdate('Y-m-d'); 30 29 } 31 30 32 $now = new DateTime();31 $now = new DateTime(); 33 32 $deadline_dt = new DateTime($deadline); 34 $interval = $now->diff($deadline_dt); 35 36 // Calculate time left string 37 if ($now > $deadline_dt) { 33 $interval = $now->diff($deadline_dt); 34 35 if ( $now > $deadline_dt ) { 38 36 $time_left = 'Deadline passed'; 39 37 } else { … … 41 39 } 42 40 43 // status on modal 44 if ($status == 'Completed') { 41 if ( $status == 'Completed' ) { 45 42 $time_left = "🎉"; 46 } elseif ($status == "Cancelled") {43 } elseif ( $status == "Cancelled" ) { 47 44 $time_left = "😢"; 48 45 } … … 57 54 <p><strong>Time Left:</strong> <?php echo esc_html($time_left); ?></p> 58 55 <div><?php echo wp_kses_post($content); ?></div> 56 59 57 <div id="wptodo-comments"> 58 <h3>Comments</h3> 60 59 <?php 61 // Load WP's comment template for this post 62 global $withcomments; 63 $withcomments = true; // Force comments to load in non-single views 64 comments_template(); 60 $comments = get_comments( array( 'post_id' => $post_id ) ); 61 foreach ( $comments as $comment ) { 62 echo '<div class="wptodo-comment" id="comment-' . esc_attr($comment->comment_ID) . '">'; 63 echo '<strong>' . esc_html($comment->comment_author) . ':</strong> '; 64 echo '<p>' . esc_html($comment->comment_content) . '</p>'; 65 echo '</div>'; 66 } 65 67 ?> 68 <form id="wptodo-comment-form"> 69 <textarea name="comment" rows="3" style="width:100%;" required></textarea> 70 <input type="hidden" name="action" value="wp-todo_add_comment" /> 71 <input type="hidden" name="post_id" value="<?php echo esc_attr( $post_id ); ?>" /> 72 <input type="hidden" name="nonce" value="<?php echo esc_attr( wp_create_nonce( 'wp-todo_action' ) ); ?>" /> 73 <button type="submit" class="button button-primary">Post Comment</button> 74 </form> 66 75 </div> 67 76 </div> … … 71 80 72 81 82 /** 83 * Admin Footer JS 84 */ 73 85 add_action( 'admin_footer-edit.php', function() { 74 86 $screen = get_current_screen(); … … 77 89 <script> 78 90 jQuery(document).ready(function($){ 79 // Add data-post-id andclickable class to rows91 // Add clickable class to rows 80 92 $('#the-list tr').each(function(){ 81 93 var post_id = $(this).attr('id'); … … 86 98 }); 87 99 88 // Click event for row100 // Quick view modal 89 101 $('#the-list').on('click', 'tr.wptodo-clickable', function(e){ 90 // Prevent click if it is on first 2 columns (checkbox/radio or title)91 102 if($(e.target).closest('th, td:first-child, td:nth-child(2)').length) return; 92 103 … … 94 105 if(!post_id) return; 95 106 96 // AJAX to fetch modal content97 107 $.post(wptodo_ajax.ajax_url, { 98 108 action: 'wp-todo_quick_view', … … 103 113 $('<div class="wptodo-modal"></div>').html(response.data).dialog({ 104 114 modal: true, 105 width: 600,115 width: 700, 106 116 title: 'Todo Details', 107 close: function() { $(this).remove(); } 117 open: function () { 118 var maxH = Math.floor(window.innerHeight * 0.8); 119 $(this).css({ maxHeight: maxH + 'px', overflowY: 'auto' }); 120 }, 121 close: function() { $(this).dialog('destroy').remove(); } 108 122 }); 109 123 } else { … … 112 126 }); 113 127 }); 128 129 // Handle AJAX comment submit 130 $(document).on('submit', '#wptodo-comment-form', function(e){ 131 e.preventDefault(); 132 var form = $(this); 133 $.post(wptodo_ajax.ajax_url, form.serialize(), function(response){ 134 if(response.success){ 135 $('#wptodo-comments h3').after(response.data.html); 136 form[0].reset(); 137 } else { 138 alert(response.data); 139 } 140 }); 141 }); 114 142 }); 115 143 </script> 144 <style> 145 /* Scrollable modal */ 146 .ui-dialog .ui-dialog-content.wptodo-modal { 147 max-height: calc(100vh - 160px) !important; 148 overflow-y: auto !important; 149 padding-right: 10px; 150 } 151 /* Scroll only comments if long */ 152 #wptodo-comments { 153 max-height: 40vh; 154 overflow-y: auto; 155 border: 1px solid #ddd; 156 padding: 8px; 157 background: #fff; 158 } 159 .wptodo-comment { margin-bottom: 10px; } 160 </style> 116 161 <?php 117 162 }); 118 163 164 165 /** 166 * Enqueue scripts/styles 167 */ 119 168 add_action('admin_enqueue_scripts', function() { 120 wp_enqueue_script('comment-reply');121 169 wp_enqueue_style('wp-admin'); 122 170 }); 171 172 173 /** 174 * AJAX: Add Comment 175 */ 176 add_action('wp_ajax_wp-todo_add_comment', function() { 177 $nonce = isset($_POST['nonce']) ? sanitize_text_field(wp_unslash($_POST['nonce'])) : ''; 178 if ( ! wp_verify_nonce($nonce, 'wp-todo_action') ) { 179 wp_send_json_error('Security check failed'); 180 } 181 182 $current_user = wp_get_current_user(); 183 $commentdata = array( 184 'comment_post_ID' => isset($_POST['post_id']) ? intval($_POST['post_id']) : '', 185 'comment_content' => isset($_POST['comment']) ? sanitize_textarea_field(wp_unslash($_POST['comment'])) : '', 186 'user_id' => $current_user->ID, 187 'comment_author' => $current_user->display_name, 188 'comment_author_email' => $current_user->user_email, 189 'comment_approved' => 1, 190 ); 191 192 $comment_id = wp_new_comment($commentdata); 193 194 if ($comment_id) { 195 $comment = get_comment($comment_id); 196 197 ob_start(); 198 echo '<div class="wptodo-comment" id="comment-' . esc_attr($comment->comment_ID) . '">'; 199 echo '<strong>' . esc_html($comment->comment_author) . ':</strong> '; 200 echo '<p>' . esc_html($comment->comment_content) . '</p>'; 201 echo '</div>'; 202 $html = ob_get_clean(); 203 204 wp_send_json_success( array( 'html' => $html ) ); 205 } else { 206 wp_send_json_error('Failed to add comment'); 207 } 208 }); 209 210 211 /** 212 * Disable moderation for wp-todo CPT 213 */ 214 add_filter('pre_comment_approved', function($approved, $commentdata) { 215 if (isset($commentdata['comment_post_ID'])) { 216 $post_type = get_post_type($commentdata['comment_post_ID']); 217 if ($post_type === 'wp-todo') { 218 return 1; 219 } 220 } 221 return $approved; 222 }, 10, 2); -
wp-todo/trunk/todo/wptodo_custom_post_type.php
r3345168 r3348753 51 51 'publicly_queryable' => false, 52 52 'show_ui' => true, 53 'show_in_menu' => true,53 'show_in_menu' => false, 54 54 'show_in_nav_menus' => false, 55 55 'show_in_admin_bar' => false, … … 59 59 'capability_type' => 'post', 60 60 'capabilities' => array(), 61 'supports' => array( 'title', 'editor', 'revisions' ),61 'supports' => array( 'title', 'editor', 'revisions', 'author', 'comments' ), 62 62 'taxonomies' => array(), 63 63 'has_archive' => true, -
wp-todo/trunk/wp-todo.php
r3345168 r3348753 5 5 /* 6 6 Plugin Name: WP To Do 7 Plugin URI: https://sandalia.com.bd/apps 7 Plugin URI: https://sandalia.com.bd/apps/view_project.php?slug=wp-todo 8 8 Description: WP-Todo: A full-featured WordPress plugin to create, manage, and track tasks with custom statuses, priorities, and deadlines from your dashboard. 9 Version:2. 0.29 Version:2.1.0 10 10 Author: Delower 11 Author URI: https:// sandalia.com.bd/apps11 Author URI: https://github.com/delower186 12 12 License: GPLv2 or later 13 13 Text Domain: wp-todo … … 44 44 include PLUGIN_DIR_PATH . "todo/modal_view.php"; 45 45 include PLUGIN_DIR_PATH . "todo/count_down_timer.php"; 46 include PLUGIN_DIR_PATH . "inc/dashboard.php";
Note: See TracChangeset
for help on using the changeset viewer.