diff --git a/languages/code-snippets.pot b/languages/code-snippets.pot index fe2eccc5..4077bced 100644 --- a/languages/code-snippets.pot +++ b/languages/code-snippets.pot @@ -224,249 +224,241 @@ msgstr "" msgid "Snippets per page" msgstr "" -#: php/class-list-table.php:154 +#: php/class-list-table.php:153 msgid "Network Active" msgstr "" -#: php/class-list-table.php:156 +#: php/class-list-table.php:155 msgid "Network Only" msgstr "" -#: php/class-list-table.php:162 +#: php/class-list-table.php:161 msgid "Edit" msgstr "" -#: php/class-list-table.php:163, php/class-list-table.php:415 +#: php/class-list-table.php:162, php/class-list-table.php:413 msgid "Clone" msgstr "" -#: php/class-list-table.php:164, php/class-list-table.php:417, php/admin-menus/class-edit-menu.php:635 +#: php/class-list-table.php:163, php/class-list-table.php:415, php/admin-menus/class-edit-menu.php:635 msgid "Export" msgstr "" -#: php/class-list-table.php:173, php/class-list-table.php:418, php/admin-menus/class-edit-menu.php:636 +#: php/class-list-table.php:172, php/class-list-table.php:416, php/admin-menus/class-edit-menu.php:636 msgid "Delete" msgstr "" -#: php/class-list-table.php:177 +#: php/class-list-table.php:176 msgid "You are about to permanently delete the selected item." msgstr "" -#: php/class-list-table.php:178, php/admin-menus/class-edit-menu.php:664 +#: php/class-list-table.php:177, php/admin-menus/class-edit-menu.php:664 msgid "'Cancel' to stop, 'OK' to delete." msgstr "" -#: php/class-list-table.php:202 +#: php/class-list-table.php:201 msgid "Run Once" msgstr "" -#: php/class-list-table.php:207, php/class-list-table.php:414 +#: php/class-list-table.php:206, php/class-list-table.php:412 msgid "Network Deactivate" msgstr "" -#: php/class-list-table.php:207, php/class-list-table.php:413 +#: php/class-list-table.php:206, php/class-list-table.php:411 msgid "Network Activate" msgstr "" -#: php/class-list-table.php:208, php/class-list-table.php:414, php/admin-menus/class-manage-menu.php:141, php/views/edit.php:104 +#: php/class-list-table.php:207, php/class-list-table.php:412, php/admin-menus/class-manage-menu.php:141, php/views/edit.php:104 msgid "Deactivate" msgstr "" -#: php/class-list-table.php:208, php/class-list-table.php:413, php/admin-menus/class-manage-menu.php:140, php/views/edit.php:110 +#: php/class-list-table.php:207, php/class-list-table.php:411, php/admin-menus/class-manage-menu.php:140, php/views/edit.php:110 msgid "Activate" msgstr "" #. translators: %d: snippet identifier -#: php/class-list-table.php:231 +#: php/class-list-table.php:230 msgid "Untitled #%d" msgstr "" -#: php/class-list-table.php:255 +#: php/class-list-table.php:254 msgid "Shared on Network" msgstr "" -#. translators: 1: date format, 2: time format -#: php/class-list-table.php:343 -msgctxt "date and time format" -msgid "%1$s \a\t %2$s" -msgstr "" - #. translators: %s: Human-readable time difference. -#: php/class-list-table.php:348 +#: php/class-list-table.php:343 msgid "%s ago" msgstr "" -#: php/class-list-table.php:350 +#: php/class-list-table.php:345 msgid "Y/m/d" msgstr "" -#: php/class-list-table.php:353 -msgid "Created" -msgstr "" - -#: php/class-list-table.php:353 -msgid "Last Modified" +#. translators: 1: date format, 2: time format +#: php/class-list-table.php:349 +msgctxt "date and time format" +msgid "%1$s \a\t %2$s" msgstr "" -#: php/class-list-table.php:365, php/views/edit.php:80 +#: php/class-list-table.php:363, php/views/edit.php:80 msgid "Name" msgstr "" -#: php/class-list-table.php:366 +#: php/class-list-table.php:364 msgid "ID" msgstr "" -#: php/class-list-table.php:367, php/admin-menus/class-edit-menu.php:336 +#: php/class-list-table.php:365, php/admin-menus/class-edit-menu.php:336 msgid "Description" msgstr "" -#: php/class-list-table.php:368, php/admin-menus/class-edit-menu.php:369 +#: php/class-list-table.php:366, php/admin-menus/class-edit-menu.php:369 msgid "Tags" msgstr "" -#: php/class-list-table.php:369 -msgid "Date" +#: php/class-list-table.php:367 +msgid "Modified" msgstr "" -#: php/class-list-table.php:370, php/admin-menus/class-edit-menu.php:388 +#: php/class-list-table.php:368, php/admin-menus/class-edit-menu.php:388 msgid "Priority" msgstr "" -#: php/class-list-table.php:416, php/admin-menus/class-edit-menu.php:632 +#: php/class-list-table.php:414, php/admin-menus/class-edit-menu.php:632 msgid "Download" msgstr "" #. translators: %s: total number of snippets -#: php/class-list-table.php:460 +#: php/class-list-table.php:458 msgid "All (%s)" msgid_plural "All (%s)" msgstr[0] "" msgstr[1] "" #. translators: %s: total number of active snippets -#: php/class-list-table.php:463 +#: php/class-list-table.php:461 msgid "Active (%s)" msgid_plural "Active (%s)" msgstr[0] "" msgstr[1] "" #. translators: %s: total number of inactive snippets -#: php/class-list-table.php:466 +#: php/class-list-table.php:464 msgid "Inactive (%s)" msgid_plural "Inactive (%s)" msgstr[0] "" msgstr[1] "" #. translators: %s: total number of recently activated snippets -#: php/class-list-table.php:469 +#: php/class-list-table.php:467 msgid "Recently Active (%s)" msgid_plural "Recently Active (%s)" msgstr[0] "" msgstr[1] "" -#: php/class-list-table.php:538 +#: php/class-list-table.php:536 msgid "Show all tags" msgstr "" -#: php/class-list-table.php:552 +#: php/class-list-table.php:550 msgid "Filter" msgstr "" -#: php/class-list-table.php:560 +#: php/class-list-table.php:558 msgid "Clear List" msgstr "" -#: php/class-list-table.php:785 +#: php/class-list-table.php:783 msgid "No snippets were found matching the current search query. Please enter a new query or use the \"Clear Filters\" button above." msgstr "" -#: php/class-list-table.php:788 +#: php/class-list-table.php:786 msgid "It looks like you don't have any snippets." msgstr "" -#: php/class-list-table.php:792 +#: php/class-list-table.php:790 msgid "Perhaps you would like to add a new one?" msgstr "" -#: php/class-list-table.php:1122 +#: php/class-list-table.php:1120 msgid "Search results" msgstr "" #. translators: 1: search query, 2: line number -#: php/class-list-table.php:1130 +#: php/class-list-table.php:1128 msgid " for “%1$s” on line %2$d" msgstr "" #. translators: %s: search query -#: php/class-list-table.php:1137 +#: php/class-list-table.php:1135 msgid " for “%s”" msgstr "" #. translators: %s: tag name -#: php/class-list-table.php:1143 +#: php/class-list-table.php:1141 msgid " in tag “%s”" msgstr "" -#: php/class-list-table.php:1151 +#: php/class-list-table.php:1149 msgid "Clear Filters" msgstr "" -#: php/class-upgrade.php:145 +#: php/class-upgrade.php:149 +msgid "You can remove it, or edit it to add your own content." +msgstr "" + +#: php/class-upgrade.php:154 msgid "Example HTML shortcode" msgstr "" -#: php/class-upgrade.php:148 +#: php/class-upgrade.php:157 msgid "write your HTML shortcode content here" msgstr "" -#: php/class-upgrade.php:150 +#: php/class-upgrade.php:159 msgid "This is an example snippet for demonstrating how to add an HTML shortcode." msgstr "" -#: php/class-upgrade.php:155 +#: php/class-upgrade.php:164 msgid "Example CSS snippet" msgstr "" -#: php/class-upgrade.php:158 +#: php/class-upgrade.php:167 msgid "write your CSS code here" msgstr "" -#: php/class-upgrade.php:160 +#: php/class-upgrade.php:169 msgid "This is an example snippet for demonstrating how to add custom CSS code to your website." msgstr "" -#: php/class-upgrade.php:166 +#: php/class-upgrade.php:175 msgid "Example JavaScript snippet" msgstr "" -#: php/class-upgrade.php:169 +#: php/class-upgrade.php:178 msgid "write your JavaScript code here" msgstr "" -#: php/class-upgrade.php:171 +#: php/class-upgrade.php:180 msgid "This is an example snippet for demonstrating how to add custom JavaScript code to your website." msgstr "" -#: php/class-upgrade.php:177 +#: php/class-upgrade.php:186 msgid "Order snippets by name" msgstr "" -#: php/class-upgrade.php:179 +#: php/class-upgrade.php:188 msgid "Order snippets by name by default in the snippets table." msgstr "" -#: php/class-upgrade.php:185 +#: php/class-upgrade.php:194 msgid "Order snippets by date" msgstr "" -#: php/class-upgrade.php:187 +#: php/class-upgrade.php:197 msgid "Order snippets by last modification date by default in the snippets table." msgstr "" -#: php/class-upgrade.php:196 -msgid "You can remove it, or edit it to add your own content." -msgstr "" - #: php/class-validator.php:152 msgid "Parse error: syntax error, unexpected end of snippet." msgstr "" diff --git a/php/class-snippet.php b/php/class-snippet.php index 9305e40f..5ebb8231 100644 --- a/php/class-snippet.php +++ b/php/class-snippet.php @@ -349,17 +349,10 @@ private function prepare_modified( $modified ) { } /** - * Retrieve the current date and time in MySQL format. - */ - public static function current_date() { - return gmdate( Code_Snippet::DATE_FORMAT ); - } - - /** - * Update the last modification date to the current time. + * Update the last modification date to the current date and time. */ public function update_modified() { - $this->modified = self::current_date(); + $this->modified = gmdate( Code_Snippet::DATE_FORMAT ); } /** diff --git a/php/snippet-ops.php b/php/snippet-ops.php index 31d661ed..0d689367 100644 --- a/php/snippet-ops.php +++ b/php/snippet-ops.php @@ -206,13 +206,7 @@ function activate_snippet( $id, $multisite = null ) { return false; } - $wpdb->update( - $table, - array( 'active' => '1', 'modified' => Code_Snippet::current_date() ), - array( 'id' => $id ), - array( '%d', '%s' ), - array( '%d' ) - ); + $wpdb->update( $table, array( 'active' => '1' ), array( 'id' => $id ), array( '%d' ), array( '%d' ) ); /* Remove snippet from shared network snippet list if it was Network Activated */ if ( $table === $db->ms_table && $shared_network_snippets = get_site_option( 'shared_network_snippets', false ) ) { @@ -269,11 +263,8 @@ function activate_snippets( array $ids, $multisite = null ) { /* Build a SQL query containing all the valid snippet IDs and activate the valid snippets */ $ids_format = implode( ',', array_fill( 0, count( $valid_ids ), '%d' ) ); - $sql = sprintf( 'UPDATE %s SET active = 1, modified = %%s WHERE id IN (%s);', $table, $ids_format ); - - array_unshift( $valid_ids, Code_Snippet::current_date() ); + $sql = sprintf( 'UPDATE %s SET active = 1 WHERE id IN (%s);', $table, $ids_format ); $wpdb->query( $wpdb->prepare( $sql, $valid_ids ) ); - array_shift( $valid_ids ); /* Remove snippet from shared network snippet list if it was Network Activated */ if ( $table === $db->ms_table && $shared_network_snippets = get_site_option( 'shared_network_snippets', false ) ) { @@ -303,13 +294,7 @@ function deactivate_snippet( $id, $multisite = null ) { /* Set the snippet to active */ - $wpdb->update( - $table, - array( 'active' => '0', 'modified' => Code_Snippet::current_date() ), - array( 'id' => $id ), - array( '%d', '%s' ), - array( '%d' ) - ); + $wpdb->update( $table, array( 'active' => '0' ), array( 'id' => $id ), array( '%d' ), array( '%d' ) ); /* Update the recently active list */