Changeset 3070239
- Timestamp:
- 04/14/2024 02:46:14 PM (4 months ago)
- Location:
- schedulify
- Files:
-
- 4 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedulify/trunk/schedulify.php
r3070223 r3070239 5 5 Author: WP Corner 6 6 Author URI: https://wpcorner.co 7 Version: 1.0. 37 Version: 1.0. 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 14 14 // Exit if accessed directly 15 if ( ! defined( 'ABSPATH' ) ) exit;15 if ( 16 16 17 17 // Plugin basename for further reference … … 84 84 $admin_email = get_option('admin_email'); 85 85 86 $subject = sprintf(esc_html__('Scheduled Post Published: #%d', 'schedulify'), $post_id); 87 $message = sprintf(esc_html__('The scheduled post #%d has been published.', 'schedulify'), $post_id); 86 $post = get_post($post_id); 87 $post_title = $post ? $post->post_title : ''; 88 89 $subject = sprintf(esc_html__('Scheduled Post Published: %s', 'schedulify'), esc_html($post_title)); 90 $message = sprintf(esc_html__('The scheduled post "%s" (ID: %d) has been published.', 'schedulify'), esc_html($post_title), absint($post_id)); 88 91 89 92 wp_mail($admin_email, $subject, $message); 90 93 } 91 94 92 /** 93 * Add plugin activation link 94 * 95 * @param $links 96 * @return array 97 */ 98 function schedulify_plugin_activation_link($links) 99 { 100 $links[] = '<a href="edit.php?post_status=future&post_type=post">' . esc_html__('Scheduled Posts', 'schedulify') . '</a>'; 101 102 return $links; 103 } 104 105 /** 106 * Add link in plugin row meta 107 * 108 * @param $links 109 * @param $file 110 * @return array 111 */ 112 function schedulify_plugin_row_meta($links, $file) 113 { 114 if (false === is_admin()) { 115 return; 116 } 117 118 if (false === current_user_can('administrator')) { 119 return; 120 } 121 122 if ($file == plugin_basename(__FILE__)) { 123 $links[] = '<a href="https://wpcorner.co/docs/schedulify/">' . esc_html__('Documentation', 'schedulify') . '</a>'; 124 } 125 126 return $links; 95 // ... (rest of the code remains the same) ... 96 97 /** 98 * Add activation link under the Posts menu 99 */ 100 function schedulify_add_activation_link_to_menu() 101 { 102 if (!current_user_can('manage_options')) { 103 return; 104 } 105 106 add_submenu_page( 107 'edit.php?post_type=post', 108 esc_html__('Schedulify', 'schedulify'), 109 esc_html__('Schedulify', 'schedulify'), 110 'manage_options', 111 'schedulify_activation_page', 112 '__return_null' 113 ); 127 114 } 128 115 … … 132 119 function schedulify_add_settings_link_to_menu() 133 120 { 121 122 123 124 134 125 add_menu_page( 135 126 esc_html__('Schedulify', 'schedulify'), … … 157 148 function schedulify_add_cron_event_stats_link_to_menu() 158 149 { 150 151 152 153 159 154 add_submenu_page( 160 155 'schedulify_settings_page',
Note: See TracChangeset
for help on using the changeset viewer.