diff --git a/.gitignore b/.gitignore index e763934..74b008e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules todo /assets/block-editor/build/ -/blocks/build/ \ No newline at end of file +/blocks/build/ +.idea diff --git a/functions.php b/functions.php index 5056a14..627b4e1 100644 --- a/functions.php +++ b/functions.php @@ -11,7 +11,7 @@ /** * Call the republish function directly - * + * * @since 1.8.0 * @param bool $escape Escape true|false * @param bool $only_date Return only date true|false @@ -30,13 +30,13 @@ function get_the_last_modified_info( $escape = false, $only_date = false ) { /** * Call the republish function directly - * + * * @since 1.8.0 * @param bool $escape Escape true|false * @param bool $date Return only date true|false */ function the_last_modified_info( $escape = false, $date = false ) { // displays/echos the last modified info. - echo get_the_last_modified_info( $escape, $date ); + echo get_the_last_modified_info( $escape, $date ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } -} \ No newline at end of file +} diff --git a/inc/Api/Callbacks/AdminCallbacks.php b/inc/Api/Callbacks/AdminCallbacks.php index 4603926..d5e3108 100644 --- a/inc/Api/Callbacks/AdminCallbacks.php +++ b/inc/Api/Callbacks/AdminCallbacks.php @@ -1,4 +1,4 @@ -
-

-

+

+

-
+
sectionHeader( $attr['title'], $attr['description'] ); ?>
@@ -48,4 +48,4 @@ public function doSettingsSection( $attr ) { ?>
'wplmi_enable_plugin', ] ); } - - /* ============================================================================================== - Template Tags + + /* ============================================================================================== + Template Tags ============================================================================================== */ public function template_date_type( $args ) { @@ -251,8 +253,8 @@ public function template_display_info( $args ) { ] ); } - /* ============================================================================================== - Schema Options + /* ============================================================================================== + Schema Options ============================================================================================== */ public function enable_schema( $args ) { @@ -270,7 +272,7 @@ public function enable_schema( $args ) { ], ] ); } - + public function schema_post_types( $args ) { $this->do_field( [ 'type' => 'multiple', @@ -283,7 +285,7 @@ public function schema_post_types( $args ) { 'condition' => [ 'wplmi_enable_schema', '=', 'enable' ], ] ); } - + public function enhanced_schema( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -294,11 +296,11 @@ public function enhanced_schema( $args ) { 'condition' => [ 'wplmi_enable_schema', '=', 'inline' ], ] ); } - - /* ============================================================================================== - Notification Options + + /* ============================================================================================== + Notification Options ============================================================================================== */ - + public function enable_notification( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -308,7 +310,7 @@ public function enable_notification( $args ) { 'description' => __( 'Enable this if you want to receive email notification if anyone makes changes to any post of your blog.', 'wp-last-modified-info' ), ] ); } - + public function author_notification( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -319,7 +321,7 @@ public function author_notification( $args ) { 'show_if' => 'wplmi_enable_notification', ] ); } - + public function draft_notification( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -330,7 +332,7 @@ public function draft_notification( $args ) { 'show_if' => 'wplmi_enable_notification', ] ); } - + public function recipients_list( $args ) { $this->do_field( [ 'id' => $args['label_for'], @@ -342,7 +344,7 @@ public function recipients_list( $args ) { 'show_if' => 'wplmi_enable_notification', ] ); } - + public function notification_post_types( $args ) { $this->do_field( [ 'type' => 'multiple', @@ -370,7 +372,7 @@ public function email_notification_subject( $args ) { 'show_if' => 'wplmi_enable_notification', ] ); } - + public function email_notification_message( $args ) { $default = 'The following changes are made on a %post_type% of your blog by %modified_author_name%' . "\n\n" . '

Post: %post_title%

%post_diff%

'; $this->do_field( [ @@ -383,10 +385,10 @@ public function email_notification_message( $args ) { ] ); } - /* ============================================================================================== + /* ============================================================================================== Misc Options ============================================================================================== */ - + public function admin_bar( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -396,7 +398,7 @@ public function admin_bar( $args ) { 'description' => __( 'Enable this if you want to show last modified info on WordPress admin bar.', 'wp-last-modified-info' ), ] ); } - + public function disable_plugin_info( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -406,7 +408,7 @@ public function disable_plugin_info( $args ) { 'description' => __( 'Enable this if you do not want to show last updated info on plugins page.', 'wp-last-modified-info' ), ] ); } - + public function admin_sort_order( $args ) { $this->do_field( [ 'type' => 'select', @@ -421,7 +423,7 @@ public function admin_sort_order( $args ) { ], ] ); } - + public function sort_order( $args ) { $this->do_field( [ 'type' => 'select', @@ -436,7 +438,7 @@ public function sort_order( $args ) { ], ] ); } - + public function replace_date( $args ) { $this->do_field( [ 'type' => 'select', @@ -451,7 +453,7 @@ public function replace_date( $args ) { ], ] ); } - + public function custom_css( $args ) { $this->do_field( [ 'type' => 'textarea', @@ -462,7 +464,7 @@ public function custom_css( $args ) { 'description' => sprintf( __( 'Do not add %s tag. This tag is not required, as it is already added.', 'wp-last-modified-info' ), '<style></style>' ), ] ); } - + public function delete_data( $args ) { $this->do_field( [ 'type' => 'checkbox', @@ -475,29 +477,30 @@ public function delete_data( $args ) { /** * Generate template tags output. - * + * * @since 1.8.0 */ private function generate_template_tags( $tags ) { ob_start() ?>
- . + . :
-
get_available_tags( $tags ); ?>
+
get_available_tags( $tags ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
%' . esc_html( $tag ) . '%'; @@ -505,4 +508,4 @@ private function get_available_tags( $tags ) { return join( ' ', $content ); } -} \ No newline at end of file +} diff --git a/inc/Base/AdminNotice.php b/inc/Base/AdminNotice.php index d64b29b..cf69759 100644 --- a/inc/Base/AdminNotice.php +++ b/inc/Base/AdminNotice.php @@ -1,4 +1,4 @@ -

' . __( 'Your version of PHP is below the minimum version of PHP required by WP Last Modified Info plugin. Please contact your host and request that your version be upgraded to 5.6 or later.', 'wp-last-modified-info' ) . '

'; + echo '

' . esc_html__( 'Your version of PHP is below the minimum version of PHP required by WP Last Modified Info plugin. Please contact your host and request that your version be upgraded to 5.6 or later.', 'wp-last-modified-info' ) . '

'; return; } - + // Check transient, if available display notice if ( get_transient( 'wplmi-show-notice-on-activation' ) !== false ) { ?>
-

here to configure plugin settings.', 'wp-last-modified-info' ), 'WP Last Modified Info', esc_html( $this->version ), esc_url( admin_url( 'options-general.php?page=wp-last-modified-info' ) ) ); ?>

+ printf( esc_html__( 'Thanks for installing %1$s v%2$s plugin. Click here to configure plugin settings.', 'wp-last-modified-info' ), 'WP Last Modified Info', esc_html( $this->version ), esc_url( admin_url( 'options-general.php?page=wp-last-modified-info' ) ) ); ?>

- +
-

5-star rating on WordPress? Just to help us spread the word and boost my motivation.', 'wp-last-modified-info' ); ?>

+

5-star rating on WordPress? Just to help us spread the word and boost my motivation.', 'wp-last-modified-info' ); ?>

  -  | -  | -

+  | +  | +

- +
-

+

  -  | -  | -

+  | +  | +

load( 'css', 'admin', 'admin.min.css', $this->version ); $this->load( 'css', 'selectize', 'selectize.min.css', '0.15.2' ); $this->load( 'css', 'confirm', 'jquery-confirm.min.css', '3.3.4' ); - + $this->load( 'js', 'selectize', 'selectize.min.js', '0.15.2', [ 'jquery' ] ); $this->load( 'js', 'confirm', 'jquery-confirm.min.js', '3.3.4', [ 'jquery' ] ); $this->load( 'js', 'admin', 'admin.min.js', $this->version, [ 'jquery', 'jquery-form', 'jquery-ui-resizable', 'wplmi-confirm', 'wplmi-selectize' ] ); - + $args = [ 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'copied' => __( 'Copied!', 'wp-last-modified-info' ), @@ -121,4 +122,4 @@ private function load( $type, $handle, $name, $version, $dep = [], $end = true ) wp_enqueue_script( 'wplmi-' . $handle, $this->plugin_url . 'assets/js/' . $name, $dep, $version, $end ); } } -} \ No newline at end of file +} diff --git a/inc/Base/PluginTools.php b/inc/Base/PluginTools.php index ba12129..613885c 100644 --- a/inc/Base/PluginTools.php +++ b/inc/Base/PluginTools.php @@ -1,4 +1,4 @@ -ajax( 'process_import_plugin_data', 'import_data' ); $this->ajax( 'process_delete_plugin_data', 'remove_settings' ); } - + /** * Process a settings export that generates a .json file */ public function export_settings() { - if ( empty( $_POST['wplmi_export_action'] ) || 'wplmi_export_settings' != $_POST['wplmi_export_action'] ) { + if ( empty( $_POST['wplmi_export_action'] ) || 'wplmi_export_settings' !== $_POST['wplmi_export_action'] ) { return; } - if ( ! wp_verify_nonce( $_POST['wplmi_export_nonce'], 'wplmi_export_nonce' ) ) { + if ( ! isset( $_POST['wplmi_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wplmi_export_nonce'] ) ), 'wplmi_export_nonce' ) ) { return; } @@ -64,7 +66,7 @@ public function export_settings() { header( 'Content-Disposition: attachment; filename=' . str_replace( '/', '-', $output ) . '-wplmi-export-' . date( 'm-d-Y' ) . '.json' ); header( "Expires: 0" ); - echo json_encode( $settings ); + echo wp_json_encode( $settings ); exit; } @@ -72,11 +74,11 @@ public function export_settings() { * Process a settings import from a json file */ public function import_settings() { - if ( empty( $_POST['wplmi_import_action'] ) || 'wplmi_import_settings' != $_POST['wplmi_import_action'] ) { + if ( empty( $_POST['wplmi_import_action'] ) || 'wplmi_import_settings' !== $_POST['wplmi_import_action'] ) { return; } - if ( ! wp_verify_nonce( $_POST['wplmi_import_nonce'], 'wplmi_import_nonce' ) ) { + if ( ! isset( $_POST['wplmi_import_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wplmi_import_nonce'] ) ), 'wplmi_import_nonce' ) ) { return; } @@ -84,24 +86,30 @@ public function import_settings() { return; } - $extension = explode( '.', sanitize_text_field( $_FILES['import_file']['name'] ) ); + $extension = explode( '.', sanitize_text_field( $_FILES['import_file']['name'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated $file_extension = end( $extension ); if ( 'json' !== $file_extension ) { - wp_die( __( 'Settings import failed: Please upload a valid .json file to import settings in this website.', 'wp-last-modified-info' ) ); + wp_die( sprintf( '%s: %s', + esc_html__( 'Settings import failed', 'wp-last-modified-info' ), + esc_html__( 'Please upload a valid .json file to import settings in this website.', 'wp-last-modified-info' ) + ) ); } - $import_file = sanitize_text_field( $_FILES['import_file']['tmp_name'] ); + $import_file = sanitize_text_field( $_FILES['import_file']['tmp_name'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated if ( empty( $import_file ) ) { - wp_die( __( 'Settings import failed: Please upload a file to import.', 'wp-last-modified-info' ) ); + wp_die( sprintf( '%s: %s', + esc_html__( 'Settings import failed', 'wp-last-modified-info' ), + esc_html__( 'Please upload a file to import.', 'wp-last-modified-info' ) + ) ); } // Retrieve the settings from the file and convert the json object to an array. - $settings = (array) json_decode( file_get_contents( $import_file ) ); + $settings = (array) json_decode( file_get_contents( $import_file ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents update_option( 'lmt_plugin_global_settings', $settings, false ); // set temporary transient for admin notice set_transient( 'wplmi_import_db_done', true ); - + wp_safe_redirect( add_query_arg( 'page', 'wp-last-modified-info', admin_url( 'options-general.php' ) ) ); exit; } @@ -113,11 +121,11 @@ public function set_meta() { // security check $this->verify_nonce(); - if ( ! isset( $_POST['action_type'] ) ) { + if ( ! isset( $_POST['action_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing $this->error(); } - $action = sanitize_text_field( wp_unslash( $_POST['action_type'] ) ); + $action = sanitize_text_field( wp_unslash( $_POST['action_type'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing $value = ( $action == 'check' ) ? 'yes' : 'no'; $args = [ @@ -126,14 +134,14 @@ public function set_meta() { 'post_status' => [ 'publish', 'draft', 'pending', 'future' ], 'fields' => 'ids', ]; - + $posts = get_posts( $args ); if ( ! empty( $posts ) ) { foreach ( $posts as $post_id ) { $this->update_meta( $post_id, '_lmt_disableupdate', $value ); } } - + $this->success( [ 'reload' => false, ] ); @@ -147,9 +155,9 @@ public function copy_data() { $this->verify_nonce(); $option = get_option( 'lmt_plugin_global_settings' ); - + $this->success( [ - 'elements' => json_encode( $option ), + 'elements' => wp_json_encode( $option ), ] ); } @@ -168,12 +176,12 @@ public function import_data() { $this->error(); } - $data = wp_unslash( $_REQUEST['settings_data'] ); + $data = wp_unslash( $_REQUEST['settings_data'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $settings = (array) json_decode( $data ); if ( is_array( $settings ) && ! empty( $settings ) ) { update_option( 'lmt_plugin_global_settings', $settings, false ); - + // set temporary transient for admin notice set_transient( 'wplmi_import_db_done', true ); } @@ -187,7 +195,7 @@ public function import_data() { public function remove_settings() { // security check $this->verify_nonce(); - + // Remove options delete_option( 'lmt_plugin_global_settings' ); delete_option( 'wplmi_site_global_update_info' ); @@ -211,8 +219,8 @@ public function remove_settings() { */ public function admin_notice() { if ( get_transient( 'wplmi_import_db_done' ) !== false ) { ?> -

'wplmi-update', @@ -68,10 +69,10 @@ public function admin_bar( $wp_admin_bar ) { 'target' => '_blank', ), ); - + $wp_admin_bar->add_node( $args ); } - + /** * Generate title to show on admin bar */ @@ -80,12 +81,12 @@ private function title() { $cur_time = current_time( 'U' ); $mod_time = $this->get_modified_date( 'U' ); $org_time = get_post_time( 'U', false, get_the_ID(), true ); - + if ( $mod_time > $cur_time || $org_time > $mod_time ) { /* translators: %s: date time info */ return sprintf( __( 'Updated on %1$s at %2$s', 'wp-last-modified-info' ), $this->get_modified_date( 'M j' ), $this->get_modified_date( get_option( 'time_format' ) ) ); } - + /* translators: %s: time diff */ return sprintf( __( 'Updated %s ago', 'wp-last-modified-info' ), human_time_diff( $this->get_modified_date( 'U' ), $cur_time ) ); } @@ -99,20 +100,20 @@ private function revision() { if ( ! $post instanceof \WP_Post ) { return; } - + // If user can't edit post, then don't show if ( ! current_user_can( 'edit_post', $post->ID ) ) { return; } - + $revision = wp_get_post_revisions( $post->ID ); $latest_revision = array_shift( $revision ); $url = ''; - + if ( wp_revisions_enabled( $post ) && count( $revision ) >= 1 ) { $url = get_admin_url() . 'revision.php?revision=' . $latest_revision->ID; } - + return $url; } -} \ No newline at end of file +} diff --git a/inc/Core/Backend/AdminColumn.php b/inc/Core/Backend/AdminColumn.php index c44bba9..07ceb77 100644 --- a/inc/Core/Backend/AdminColumn.php +++ b/inc/Core/Backend/AdminColumn.php @@ -20,7 +20,8 @@ */ class AdminColumn { - use Hooker, SettingsData; + use Hooker; + use SettingsData; /** * Register functions. @@ -46,13 +47,13 @@ public function generate_column() { } } } - + /** * Generate column data. - * + * * @param string $column Column name * @param int $post_id Post ID - * + * * @return string $time */ public function column_data( $column, $post_id ) { @@ -66,7 +67,7 @@ public function column_data( $column, $post_id ) { $modified = date_i18n( $this->do_filter( 'admin_column_datetime_format', $get_df . ' \a\t ' . $get_tf, $post->ID ), strtotime( $m_orig ) ); $mod_format = date( 'M d, Y H:i:s', strtotime( $m_orig ) ); $disabled = ( ! empty( $p_meta ) ) ? $p_meta : 'no'; - + $html = $modified; if ( get_the_modified_author() ) { $html .= '
' . __( 'by', 'wp-last-modified-info' ) . ' ' . esc_html( get_the_modified_author() ) . ''; @@ -81,26 +82,26 @@ public function column_data( $column, $post_id ) { $html .= ''; } $html .= ''; - - echo $html; + + echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } - + /** * Column title. - * + * * @param string $column Column name * @return string $column Filtered column */ public function column_title( $column ) { $column['lastmodified'] = __( 'Last Modified', 'wp-last-modified-info' ); - + return $column; } /** * Make Column sortable. - * + * * @param string $column Column name * @return array $column Filtered column */ @@ -116,4 +117,4 @@ public function column_sortable( $column ) { public function style() { echo ''."\n"; } -} \ No newline at end of file +} diff --git a/inc/Core/Backend/BlockEditor.php b/inc/Core/Backend/BlockEditor.php index bab79d3..506a9af 100644 --- a/inc/Core/Backend/BlockEditor.php +++ b/inc/Core/Backend/BlockEditor.php @@ -1,4 +1,4 @@ -filter( 'register_post_type_args', 'post_type_args', 9999, 2 ); $this->action( 'init', 'register_meta' ); $this->action( 'enqueue_block_editor_assets', 'assets' ); - + // AIOSEO Integration $this->action( 'init', 'filter_aioseo' ); } /** * Add support for `custom-fields` for all posts. - * + * * @param array $args Post type data * @param string $post_type Post type name - * + * * @return array $args Post type data */ public function post_type_args( $args, $post_type ) { @@ -49,9 +50,12 @@ public function post_type_args( $args, $post_type ) { } if ( ! empty( $args['show_in_rest'] ) && ! post_type_supports( $post_type, 'custom-fields' ) ) { + if ( ! isset( $args['supports'] ) ) { + $args['supports'] = []; + } $args['supports'][] = 'custom-fields'; } - + return $this->do_filter( 'post_type_args', $args, $post_type ); } @@ -59,7 +63,7 @@ public function post_type_args( $args, $post_type ) { * Register meta fields. */ public function register_meta() { - register_meta( + register_meta( 'post', '_lmt_disableupdate', [ @@ -70,10 +74,10 @@ public function register_meta() { 'auth_callback' => function () { return current_user_can( 'edit_posts' ); }, - ] + ] ); - register_meta( + register_meta( 'post', '_lmt_disable', [ @@ -110,7 +114,7 @@ public function modified_params( $prepared_post, $request ) { if ( isset( $params['modified'] ) ) { $prepared_post->wplmi_modified_rest = $params['modified']; } - + if ( isset( $params['meta']['_lmt_disableupdate'] ) ) { $prepared_post->wplmi_lockmodifiedupdate = $params['meta']['_lmt_disableupdate']; } @@ -164,4 +168,4 @@ public function filter_post( $post ) { return $post; } -} \ No newline at end of file +} diff --git a/inc/Core/Backend/DashboardWidget.php b/inc/Core/Backend/DashboardWidget.php index d5b60b0..2083e37 100644 --- a/inc/Core/Backend/DashboardWidget.php +++ b/inc/Core/Backend/DashboardWidget.php @@ -21,7 +21,8 @@ */ class DashboardWidget { - use HelperFunctions, Hooker; + use HelperFunctions; + use Hooker; /** * Register functions. @@ -36,7 +37,7 @@ public function register() { */ public function dashboard_widget() { global $wp_meta_boxes; - + \wp_add_dashboard_widget( 'dashboard_last_modified_posts', // Widget slug. __( 'Last Updated', 'wp-last-modified-info' ), // Title. @@ -78,12 +79,12 @@ public function widget_callback() { while ( $posts->have_posts() ) { $posts->the_post(); - + $modified_timestamp = get_post_modified_time( 'U' ); if ( gmdate( 'Y-m-d', $modified_timestamp ) == $today ) { - $relative = __( 'Today' ); + $relative = __( 'Today', 'wp-last-modified-info' ); } elseif ( gmdate( 'Y-m-d', $modified_timestamp ) == $tomorrow ) { - $relative = __( 'Tomorrow' ); + $relative = __( 'Tomorrow', 'wp-last-modified-info' ); } elseif ( gmdate( 'Y', $modified_timestamp ) !== gmdate( 'Y', $timestamp ) ) { /* translators: Date and time format for recent posts on the dashboard, from a different calendar year, see https://www.php.net/date */ $relative = date_i18n( 'M jS Y', $modified_timestamp ); @@ -91,32 +92,32 @@ public function widget_callback() { /* translators: Date and time format for recent posts on the dashboard, see https://www.php.net/date */ $relative = date_i18n( 'M jS', $modified_timestamp ); } - + // Use the post edit link for those who can edit, the permalink otherwise. $recent_post_link = current_user_can( 'edit_post', get_the_ID() ) ? get_edit_post_link() : get_permalink(); - + $draft_or_post_title = _draft_or_post_title(); printf( '
  • %1$s %4$s
  • ', /* translators: 1: Relative date, 2: Time. */ - sprintf( _x( '%1$s, %2$s', 'dashboard' ), $relative, date_i18n( get_option( 'time_format' ), $modified_timestamp ) ), - $recent_post_link, + sprintf( esc_html_x( '%1$s, %2$s', 'dashboard', 'wp-last-modified-info' ), esc_html( $relative ), esc_html( date_i18n( get_option( 'time_format' ), $modified_timestamp ) ) ), + esc_url( $recent_post_link ), /* translators: %s: Post title. */ - esc_attr( sprintf( __( 'Edit “%s”' ), $draft_or_post_title ) ), - $draft_or_post_title + esc_attr( sprintf( esc_html__( 'Edit “%s”', 'wp-last-modified-info' ), $draft_or_post_title ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + $draft_or_post_title // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } - + echo ''; echo ''; - + } else { echo '
    '; echo ''; - echo '

    ' . __( 'No modified posts yet!' ) . '

    '; + echo '

    ' . esc_html__( 'No modified posts yet!', 'wp-last-modified-info' ) . '

    '; echo '
    '; - + } wp_reset_postdata(); @@ -128,20 +129,20 @@ public function widget_callback() { */ public function widget_control_callback() { // Update widget options - if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['wplmi_widget_options'] ) ) { + if ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST['wplmi_widget_options'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated check_admin_referer(); update_option( 'lmt_dashboard_widget_options', array_map( 'intval', $_POST['wplmi_widget_options'] ), false ); - } + } // Get widget options $widget_options = get_option( 'lmt_dashboard_widget_options' ); $value = isset( $widget_options['number'] ) ? $widget_options['number'] : ''; - + wp_nonce_field(); ?> - +
    margin: 0; padding-bottom: 0; } - + #dashboard_last_modified_posts .dashboard-widget-control-form { padding-top: 12px; padding-bottom: 15px; } ajax( 'process_bulk_edit', 'bulk_save' ); $this->filter( 'wp_insert_post_data', 'update_data', 9999, 2 ); } - + /** * Post Submit Box HTML output. - * + * * @param string $post WP Post */ public function submitbox_edit( $post ) { global $wp_locale; - + if ( in_array( $post->post_status, [ 'auto-draft', 'future' ] ) ) { return; } - + $datemodified = $post->post_modified; - + $jj = mysql2date( 'd', $datemodified, false ); $mm = mysql2date( 'm', $datemodified, false ); $aa = mysql2date( 'Y', $datemodified, false ); $hh = mysql2date( 'H', $datemodified, false ); $mn = mysql2date( 'i', $datemodified, false ); $ss = mysql2date( 's', $datemodified, false ); - + $stop_update = $this->get_meta( $post->ID, '_lmt_disableupdate' ); $post_types = get_post_type_object( $post->post_type ); - + // get modified time with a particular format $orig_time = get_post_time( 'U', false, $post ); $mod_time = get_post_modified_time( 'U', false, $post ); ?> - +
    - +
    @@ -75,23 +77,23 @@ public function submitbox_edit( $post ) { for ( $i = 1; $i < 13; $i++ ) { $monthnum = zeroise( $i, 2 ); $monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ); - echo ''; + echo ''; } ?> ,